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 - total_statements
  • Number of statements covered by tests - covered_statements
  • Percentage of statement coverage - scoverage
  • Percentage of branch coverage - branch_scoverage

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