Skip to content

Commit 9b5d881

Browse files
committed
.
1 parent da30aa3 commit 9b5d881

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44

55
Plugin for [SonarQube] that imports statement coverage generated by [Scoverage] for Scala projects.
66

7+
Scoverage measures how many statements of a given Scala program have been covered by automated tests. This
8+
new metric is much better for Scala than traditional line coverage and branch coverage because typically:
9+
10+
1. There are many statements on a single line
11+
2. `if` statements are used rarely
12+
13+
This plugin reads XML report generated by Scoverage and populates several metrics in Sonar:
14+
15+
1. Total number of statements
16+
2. Number of statements covered by tests
17+
3. Statement coverage rate (%)
18+
19+
Projects with sub-projects are supported as well. Overall statement coverage is (sum of number of covered statements
20+
for all sub-projects) / (total number of statements for all sub-projects). In other words, it's more intelligent than
21+
just plain average of coverage rates for sub-projects.
22+
723
## Requirements ##
824

925
- [SonarQube] 4.0
@@ -28,11 +44,11 @@ root directory:
2844
If your project is based on SBT and you're using [Scoverage plugin for SBT] [sbt-scoverage] you can
2945
generate the Scoverage report by executing following from command line:
3046

31-
sbt clean scoverage:test
47+
$ sbt clean scoverage:test
3248

3349
And then run Sonar runner to upload the report to the Sonar server:
3450

35-
sonar-runner
51+
$ sonar-runner
3652

3753
## Add statement coverage columns ##
3854

0 commit comments

Comments
 (0)