Supported Metrics

In addition to reporting Scalastyle and Scapegoat issues, sonar-scala currently supports the following SonarQube metrics:

Size

  • Number of classes (and objects) - classes
  • Number of lines containing either comments or commented-out code - comment_lines
  • Number of files (computed by the platform) - files
  • Lines of code - ncloc
  • Number of functions - functions

Coverage

  • Number of lines of code which could be covered by unit tests - lines_to_cover
  • Number of lines of code which are not covered by unit tests - uncovered_lines
  • Percentage of line coverage - line_coverage

In addition to the above, sonar-scala reports the following custom metrics, which are extracted from a Scoverage report:

  • Number of all statements - sonar-scala-scoverage-total-statements
  • Number of statements covered by tests - sonar-scala-scoverage-covered-statements
  • Percentage of statement coverage - sonar-scala-scoverage-statement-coverage
  • Number of all branches - sonar-scala-scoverage-total-branches
  • Number of branches covered by tests - sonar-scala-scoverage-covered-branches
  • Percentage of branch coverage - sonar-scala-scoverage-branch-coverage

Tests

  • Number of unit tests - tests
  • Number of skipped unit tests - skipped_tests
  • Number of unit test errors - test_errors
  • Number of unit test failures - test_failures
  • Execution duration of unit tests - test_execution_time