Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Table of Contents





Number of getter and setter methods used to get (reading) or set (writing) a class property.

ClassesclassesNumber of classes (including nested classes, interfaces, enums and annotations).
DirectoriesdirectoriesNumber of directories.
FilesfilesNumber of files.
Generated Lines Number of generated lines (Cobol seulement).
Generated lines of code Number of generated lines of code (Cobol seulement).
LineslinesNumber of physical lines (number of carriage returns).
Lines of codenclocNumber of physical lines that contain at least one character which is neither a whitespace or a tabulation or part of a comment.

Number of methods.
Number of paragraphs for Cobol. 

Notes for Java:

  • Accessors are considered as methods if the sonar.squid is set to false
  • Constructors are considered as methods
PackagespackagesNumber of packages.
ProjectsprojectsNumber of projects in a view.
Public APIpublic_apiNumber of public Classes + number of public Methods + number of public Properties (without public final static ones).



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.


Branch coveragebranch_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.


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 coverageline_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 coverlines_to_coverNumber 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 coveragenew_branch_coverageIdentical to Branch coverage but restricted to new / updated source code.
New coveragenew_coverageIdentical to Coverage but restricted to new / updated source code.
New line coveragenew_line_coverageIdentical to Line coverage but restricted to new / updated source code.
New lines to covernew_lines_to_coverIdentical to Lines to cover but restricted to new / updated source code.
New uncovered linesnew_uncovered_linesIdentical to Uncovered lines but restricted to new / updated source code.
Skipped unit testsskipped_testsNumber of skipped unit tests.
Uncovered branchesuncovered_branchesNumber of branches which are not covered by unit tests.
Uncovered linesuncovered_linesNumber of lines of code which are not covered by unit tests.
Unit teststestsNumber of unit tests.
Unit tests durationtest_execution_timeTime required to execute all the unit tests.
Unit test errorstest_errorsNumber of unit tests that have failed.
Unit test failurestest_failuresNumber of unit tests that have failed with an unexpected exception.
Unit test success density (%)test_success_densityTest success density = (tests - (test_errors + test_failures)) / tests * 100

The same kinds of metrics exist for Integration tests coverage and Overall tests coverage (Units tests + Integration tests).

Metrics on tests execution does not exist for Integration tests and Overall tests.

  • No labels