...
| Name | Key | Description | ||||||
| complexity | It is the cyclomatic complexity, also known as McCabe metric. Whenever the control flow of a method splits, the complexity counter gets incremented by one. Expand | | title | ...||||
|---|---|---|---|---|---|---|---|---|
| Language | Notes | |||||||
| ABAP | The following keywords increase the complexity by one: AND, CATCH, CONTINUE, DO, ELSEIF, IF, LOOP, LOOPAT, OR, PROVIDE, SELECT…ENDSELECT, TRY, WHEN, WHILE. | |||||||
| Cobol | The following commands increase the complexity by one: ALSO, ALTER, AND, DEPENDING, END_OF_PAGE, ENTRY, EOP, EXCEPTION, EXIT, GOBACK, CONTINUE, IF, INVALID, OR, OVERFLOW, SIZE, STOP, TIMES, UNTIL, USE, VARYING, WHEN, EXEC CICS HANDLE, EXEC CICS LINK, EXEC CICS XCTL and EXEC CICS RETURN. | Java |
| Code Block |
|---|
public void process(Car myCar){ <- +1
if(myCar.isNotMine()){ <- +1
return; <- +1
}
car.paint("red");
car.changeWheel();
while(car.hasGazol() && car.getDriver().isNotStressed()){ <- +2
car.drive();
}
return;
}
|
Design
| Name | Key | Description | ||||
Afferent couplings | ca | A class afferent couplings is a measure of how many other classes use the specific class. | ||||
Depth in Tree | dit | The depth of inheritance tree (DIT) metric provides for each class a measure of the inheritance levels from the object hierarchy top. Expand | | title | ...||
|---|---|---|---|---|---|---|
| ||||||
Efferent couplings | ce | A class efferent couplings is a measure of how many different classes are used by the specific class. | ||||
File cycles | file_cycles | Minimal number of file cycles detected inside a package to be able to identify all undesired dependencies. | ||||
| file_edges_weight | Number of file dependencies inside a package. | ||||
File dependencies to cut | package_tangles | Number of file dependencies to cut in order to remove all cycles between packages. | ||||
| file_tangles | File tangle = Suspect file dependencies | ||||
| file_tangle_index | File tangle index = 2 * (File tangle / File edges weight) * 100.
| ||||
LCOM4 | lcom4 | Lack of cohesion of methods. See LCOM4 documentation page. | ||||
Number of children | noc | The number of children of a class is the number of direct and indirect descendants of this class. | ||||
Package cycles | package_cycles | Minimal number of package cycles detected to be able to identify all undesired dependencies. | ||||
Package dependencies to cut | package_feedback_edges | Number of package dependencies to cut in order to remove all cycles between packages. | ||||
Package tangle index | package_tangle_index | Level of tangle of the packages. Best value (0%) means that there is no cycle and worst value (100%) means that packages are really tangled. This metric is computed with the following formula: 2 * (File dependencies to cut / Number of file dependencies between packages) * 100. | ||||
Response for class | rfc | See RFC documentation page. | ||||
Package edges weight | package_edges_weight | Number of file dependencies between packages. | ||||
| file_feedback_edges | File dependencies to cut in order to remove cycles between files inside a package. Note that cycles between files inside a package does not always mean a bad quality architecture. | ||||
| Suspect LCOM4 density | suspect_lcom4_density | Density of files having a LCOM4 density greater than 1. |
...
| Name | Key | Description | ||||||
| Blank comments | comment_blank_lines | Number of non-significant comment lines (empty comment line, comment line containing only special characters, etc.). | ||||||
| comment_lines | Number of lines containing a comment. Expand | | title | ...||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
| Comments (%) | comment_lines_density | Density of comment lines = Comment lines / (Lines of code + Comment lines) * 100 With such a formula:
| ||||||
| Comments in Procedure Divisions | Comments in Procedure divisions (Cobol only) | |||||||
| public_documented_api_density | Density of public documented API = (Public API - Public undocumented API) / Public API * 100 | ||||||
| public_undocumented_api | Public API without comments header. |
Duplications
| Name | Key | Description | ||||
Duplicated blocks | duplicated_blocks | Number of duplicated blocks of lines. | ||||
| Duplicated files | duplicated_files | Number of files involved in a duplication. | ||||
| duplicated_lines | Number of lines involved in a duplication. | ||||
| Duplicated lines (%) | duplicated_lines_density | Density of duplication = Duplicated lines / Lines * 100 |
Reviews
| Name | Key | Description |
Active reviews | active_reviews | Number of active reviews (status not closed). |
| False-positive reviews | false_positive_reviews | Number fo false-positive reviews. |
| New unreviewed violations | new_unreviewed_violations | Number of new unreviewed violations. |
| Unassigned reviews | unassigned_reviews | Number of unassigned reviews. |
| Unplanned reviews | unplanned_reviews | Number of unplanned reviews (not associated with an action plan). |
| Unreviewed violations | unreviewed_violations | Number of unreviewed violations. |
...
| Name | Key | Description | ||||
New violations | new_violations | Number of new violations. | ||||
New xxxxx violations | new_xxxxx_violations | Number of new violations with severity xxxxx, xxxxx being Blocker, Critical, Major, Minor or Info. | ||||
Violations | violations | Number of violations. | ||||
xxxxx violations | xxxxx_violations | Number of violations with severity xxxxx, xxxxx being Blocker, Critical, Major, Minor or Info. | ||||
| weighted_violations | Sum of the violations weighted by the coefficient associated to each severity (Sum(xxxxx_violations * xxxxx_weight)). | ||||
Rules compliance | violations_density | Rules compliance index (RCI) = 100 - (Weighted violations / Lines of code * 100) |
SCM
| Name | Key | Qualitative | Description |
|---|---|---|---|
| Authors by line | authors_by_line | no | The last committer on each line of code. |
...
| Metric | Key | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| accessors | Number of getter and setter methods used to get (reading) or set (writing) a class property. Expand | | title | ...||||||||||||||||||
|
| Anchor | ||
|---|---|---|
|
| Anchor | ||
|---|---|---|
|
| Anchor | ||
|---|---|---|
|
Number of lines generated by Cobol code generators like CA-Telon.
Cobol only.
| Anchor | ||
|---|---|---|
|
| Anchor | ||
|---|---|---|
|
Number of physical lines that contain at least one character which is neither a whitespace or a tabulation or part of a comment.
| Language | Note |
|---|---|
| Cobol | Generated lines of code and pre-processing instructions (SKIP1, SKIP2, SKIP3, COPY, EJECT, REPLACE) are not counted as lines of code. |
Cobol only.
Cobol only.
| Anchor | ||
|---|---|---|
|
Number of methods/functions.
| Language | Note |
|---|---|
| Cobol | It is the number of paragraphs. |
| Java |
|
| VB.NET | Accessors are not considered as methods. |
Cobol only.
| Anchor | ||
|---|---|---|
|
| Anchor | ||
|---|---|---|
|
| Anchor | ||
|---|---|---|
|
Number of public Classes + number of public Methods + number of public Properties
Metrics - Public APIMore details
...| Language | Note |
|---|---|
| Java | Number of public properties but without public final static ones. |
| Anchor | ||
|---|---|---|
|
Number of statements.
| Language | Note |
|---|---|
| Cobol | move, if, accept, add, alter, call, cancel, close, compute, continue, delete, display, divide, entry, evaluate, exitProgram, goback, goto, initialize, inspect, merge, multiply, open, perform, read, release, return, rewrite, search, set, sort, start, stop, string, subtract, unstring, write, exec, ibmXmlParse , ibmXmlGenerate , readyReset , mfCommit , mfRollback |
| Java | Number of statements as defined in the Java Language Specification but without block definitions. Statements counter gets incremented by one each time a following keyword is encountered: if, else, while, do, for, switch, break, continue, return, throw, synchronized, catch, finally. Statements counter is not incremented by a class, method, field, annotation definition, package declaration and import declaration. |
| PL/SQL | Only includes SQL statements used within PL/SQL blocks, but not outside. |
Tests
| Metric | Key | Description | ||||||
|---|---|---|---|---|---|---|---|---|
| branch_coverage | On each line of code containing some boolean expressions, the branch coverage simply answers the following question: 'Has each boolean expression been evaluated both to true and false?'. This is the density of possible branches in flow control structures that have been followed during unit tests execution.
| ||||||
| coverage | It is a mix of Line coverage and Branch coverage. Its goal is to provide an even more accurate answer to the following question: 'How much of the source code has been covered by the unit tests?".
| ||||||
| line_coverage | On a given line of code, Line coverage simply answers the following question: 'Has this line of code been executed during the execution of the unit tests?'. It is the density of covered lines by unit tests:
| ||||||
| lines_to_cover | Number of lines of code which could be covered by unit tests (for example, blank lines or full comments lines are not considered as lines to cover). | ||||||
| New branch coverage | new_branch_coverage | Identical to Branch coverage but restricted to new / updated source code. | ||||||
| New coverage | new_coverage | Identical to Coverage but restricted to new / updated source code. | ||||||
| New line coverage | new_line_coverage | Identical to Line coverage but restricted to new / updated source code. | ||||||
| New lines to cover | new_lines_to_cover | Identical to Lines to cover but restricted to new / updated source code. | ||||||
| New uncovered lines | new_uncovered_lines | Identical to Uncovered lines but restricted to new / updated source code. | ||||||
| Skipped unit tests | skipped_tests | Number of skipped unit tests. | ||||||
| uncovered_branches | Number of branches which are not covered by unit tests. | ||||||
| uncovered_lines | Number of lines of code which are not covered by unit tests. | ||||||
| tests | Number of unit tests. | ||||||
| Unit tests duration | test_execution_time | Time required to execute all the unit tests. | ||||||
| test_errors | Number of unit tests that have failed. | ||||||
| test_failures | Number of unit tests that have failed with an unexpected exception. | ||||||
| Unit test success density (%) | test_success_density | Test success density = (Unit tests - (Unit test errors + Unit test failures)) / Unit tests * 100 |
The same kinds of metrics exist for Integration tests coverage and Overall tests coverage (Units tests + Integration tests).
...

