ADA

ADA Metrics

Andthen Operators

  • Mnemonic ANTH

  • Description Number of 'andthen' operators

Number of comment blocks

  • Mnemonic BCOM

  • Description Number of comment blocks.

Header Blocks Of Comment

  • Mnemonic BHCO

  • Description Number block of comment placed before the beginning of the artefact.

Blank Lines

  • Mnemonic BLAN

  • Description Number of blank lines of code in the source file(s).

Brace Lines

  • Mnemonic BRAC

  • Description Number of lines of code containing only a brace in the source file(s).

Case Blocks

  • Mnemonic CABL

  • Description Number of 'case' blocks in 'switch' in the function

Case Labels

  • Mnemonic CASE

  • Description Number of 'case' labels in the function

Cyclomatic Complexity

  • Mnemonic CCN

  • Description Number of linearly independent paths in the function control graph.

Control Flow Token

  • Mnemonic CFT

  • Description Number of tokens in the control flow of functions

Call Graph Depth

  • Mnemonic CGDM

  • Description Maximum depth of the call graph.

Comment Lines

  • Mnemonic CLOC

  • Description Number of lines of comments in the source file(s).

Commented Statements

  • Mnemonic CSTAT

  • Description Number of Commented Statements.

Minimum Number of Cycles

  • Mnemonic CYCL

  • Description Minimum number of call graph cycles in which the function is involved (including recursivity).

Declare operators

  • Mnemonic DECBL

  • Description Number of Declare operators

Default Statement

  • Mnemonic DEFT

  • Description Number of 'default' blocks in 'switch' in the function

Distinct Operands

  • Mnemonic DOPD

  • Description Number of distinct operands: variables and constants ([Halstead,76]: n2)

Distinct Operators

  • Mnemonic DOPT

  • Description Number of distinct operators: language keywords ([Halstead,76]: n1)

Else Statements

  • Mnemonic ELSE

  • Description Number of 'else' statements

Entry Statements

  • Mnemonic ENTRY

  • Description Number of Entry statements

Exception When blocks

  • Mnemonic EXBL

  • Description Number of 'when' blocks in 'exception handler'.

Exception handlers

  • Mnemonic EXGR

  • Description Number of Exception handlers

For Statements

  • Mnemonic FOR

  • Description Number of 'for' statements in the function

Structures Added

  • Mnemonic SADD

  • Description Number of control structures added since the previous version.

Structures Modified

  • Mnemonic SMOD

  • Description Number of control structures modified since the previous version.

Structures Removed

  • Mnemonic SREM

  • Description Number of control structures removed since the previous version.

Number of Structures

  • Mnemonic SSIZ

  • Description Number of control structures: iterations, selections, sequences

Goto Statements

  • Mnemonic GOTO

  • Description Number of 'goto' statements

Header Lines Of Comment

  • Mnemonic HCOM

  • Description Number of comment lines placed before the beginning of the artefact.

Header Lines Of Code

  • Mnemonic HLOC

  • Description Number of lines between the function or class definition and the first opening brace.

Cloned Code

  • Mnemonic ICC

  • Description Duplicated code in this artefact

Cloned Control Flow Tokens

  • Mnemonic ICFTC

  • Description Number of duplicated tokens in control flow of functions

If Statements

  • Mnemonic IF

  • Description Number of 'if' statements

Generic object

  • Mnemonic ISGEN

  • Description The object is declared generic

Label Statements

  • Mnemonic LABEL

  • Description Number of Label statements

Line Count

  • Mnemonic LC

  • Description Number of lines.

Loop Statements

  • Mnemonic LOOP

  • Description Number of loop statements in the function

Mixed Lines

  • Mnemonic MLOC

  • Description Number of lines containing both code and comment in the source files.

AND operators

  • Mnemonic NBAND

  • Description Number of AND operators

Constants

  • Mnemonic NBCONST

  • Description Number of Constants

Private constant

  • Mnemonic NBCONSTPRIV

  • Description Number of Private constants

Public constants

  • Mnemonic NBCONSTPUB

  • Description Number of Public constants

Declared functions

  • Mnemonic NBDFUNC

  • Description Number of Declared functions/procedures

Private functions/Procedures

  • Mnemonic NBDFUNCPRIV

  • Description Number of Private function/Procedure

Public functions

  • Mnemonic NBDFUNCPUB

  • Description Number of Public functions/procedures

Exceptions

  • Mnemonic NBEXCEPT

  • Description Number of Declared Exceptions

Private exceptions

  • Mnemonic NBEXCEPTPRIV

  • Description Number of Private exceptions

Public exceptions

  • Mnemonic NBEXCEPTPUB

  • Description Number of Public exceptions

Separate functions/procedures

  • Mnemonic NBFUNCDSEP

  • Description Number of Separate functions/procedures

OR operators

  • Mnemonic NBOR

  • Description Number of OR operators

Separate packages

  • Mnemonic NBPACKDSEP

  • Description Number of package declared Separate

Protected objects

  • Mnemonic NBPROTOBJDSEP

  • Description Number of Declred Protected objects

Renamed objects

  • Mnemonic NBRENA

  • Description Number of Renamed object

Subtypes

  • Mnemonic NBSTYP

  • Description Number of Subtypes

Separate tasks

  • Mnemonic NBTASKDSEP

  • Description Number of task declared Separate

Types

  • Mnemonic NBTYP

  • Description Number of Types

Derived types

  • Mnemonic NBTYPDRV

  • Description Number of Derived types

Private types

  • Mnemonic NBTYPPRIV

  • Description Number of Private types

Public types

  • Mnemonic NBTYPPUB

  • Description Number of Public types

Variables

  • Mnemonic NBVAR

  • Description Number of Variables

Private variables

  • Mnemonic NBVARPRIV

  • Description Number of Private variables

Public variables

  • Mnemonic NBVARPUB

  • Description Number of Public variables

With statements

  • Mnemonic NBWITH

  • Description Number of With statements

Maximum Nested Structures

  • Mnemonic NEST

  • Description Maximum number of nested structures

Non-Cyclic Paths

  • Mnemonic PATH

  • Description Number of non-cyclic paths in the function.

Orelse operators

  • Mnemonic OREL

  • Description Number of 'orelse' operators

Raise statements

  • Mnemonic RAISE

  • Description Number of Raise statementts

Return Statements

  • Mnemonic RETURN

  • Description Number of 'return' statements in the function

Repeated Code Blocks

  • Mnemonic RS

  • Description Duplicated blocks in the function

Skipped Lines of Comment code

  • Mnemonic SKLC

  • Description Skipped Lines of Comment code i.e. lines that match a user defined regular expression to skip lines of comments.

Source Lines Of Code

  • Mnemonic SLOC

  • Description Number of lines of source code in the source file(s).

Executable Statements

  • Mnemonic STAT

  • Description Total number of executable statements.

Switch Statements

  • Mnemonic SWIT

  • Description Number of 'switch' statements in the function

Operand Occurrences

  • Mnemonic TOPD

  • Description Number of occurrences of operands: variables and constants ([Halstead,76]: N2)

Operator Occurrences

  • Mnemonic TOPT

  • Description Number of occurrences of operators: language keywords ([Halstead,76]: N1)

Lines Added

  • Mnemonic LADD

  • Description Number of lines added since the previous version.

Lines Modified

  • Mnemonic LMOD

  • Description Number of lines modified since the previous version.

Lines Removed

  • Mnemonic LREM

  • Description Number of lines removed since the previous version.

While Statements

  • Mnemonic WHIL

  • Description Number of 'while' statements in the function

ADA Ruleset

Backward Goto shall not be used

  • Mnemonic BWGOTO

  • Description Backward gotos shall not be used.

Commented-out Source Code is not allowed

  • Mnemonic R_CSTAT

  • Description Commented-out Source Code is not allowed

Missing final else

  • Mnemonic ELSEFINAL

  • Description All if ... else if constructs shall be terminated with an else clause (see [MISRA-C:2004]: RULE 14.10).

Exit Label shall be named

  • Mnemonic EXTLABEL

  • Description Each exit label shall be named.

Use 'exit when' instead of if... exit syntax

  • Mnemonic EXTWHEN

  • Description Use 'exit when' instead of if... exit syntax.

Each loop shall be named

  • Mnemonic LOOPNAMED

  • Description Each loop shall be named.

Abort shall not be used

  • Mnemonic NOABORT

  • Description Use of 'abort'

Factorizable Classes

  • Mnemonic CAC_CL

  • Description Consider classes refactorization

Factorizable Files

  • Mnemonic CAC_FI

  • Description Consider files refactorization

Factorizable Functions

  • Mnemonic CAC_FN

  • Description Consider functions refactorization

Factorizable Packages

  • Mnemonic CAC_PKG

  • Description Consider packages refactorization

Cloned Classes

  • Mnemonic CC_CL

  • Description There shall be no duplicated classes

Cloned Files

  • Mnemonic CC_FI

  • Description There shall be no duplicated files

Cloned Functions

  • Mnemonic CC_FN

  • Description There shall be no duplicated functions

Cloned Algorithmic

  • Mnemonic CFTC_FN

  • Description There shall be no algorithmic cloning

Delay shall not be used

  • Mnemonic NODELAY

  • Description Use of 'delay'

FIXME shall not be commited in sources code

  • Mnemonic R_NOFIXME

  • Description FIXME shall not be commited in sources code as it brings confusion regarding code reliability.

GOTO shall not be used

  • Mnemonic NOGOTO

  • Description A unconditional GOTO shall not be used to jump outside the paragraph.

Avoid Duplicated Blocks in Function

  • Mnemonic RS_FN

  • Description There shall be no duplicated parts in functions

TODO shall not be commited in sources code

  • Mnemonic R_NOTODO

  • Description TODO shall not be commited in sources code as it brings confusion regarding code reliability.

There shall be no 'when others' in exception handler

  • Mnemonic NOWHEN_OTHERS

  • Description There shall be no 'when others' in exception handler.

Missing case in switch

  • Mnemonic ONECASE

  • Description Every switch statement shall have at least one case clause (see [MISRA-C:2004]: RULE 15.5).

Parameters shall be ordered: 'IN', 'OUT', 'IN OUT'.

  • Mnemonic PARAMORDER

  • Description Parameters shall be ordered: 'IN', 'OUT', 'IN OUT'.

Relaxed violation

  • Mnemonic RELAX

  • Description A rule violation is relaxed and justified.

Multiple exits are not allowed

  • Mnemonic RETURN

  • Description A function shall have a single point of exit at the end (see [MISRA-C:2004]: RULE 14.7).

Multiple Exit in loop

  • Mnemonic SGLEXT

  • Description There shall be a single exit by loop.