Hi everyone, I have a NodeJS 14 project on Sonar Enterprise 9.4 (scanner version 4.7.0.2747),
Here is the config for scanner and also for the test using mocha and istanbul.
sonar.sources="lib"
sonar.language="js"
sonar.javascript.lcov.reportPaths="coverage/lcov.info"
sonar.exclusions="lib/gen-nodejs/**,lib/payload/protobuf/Gateway_pb.js,examples/**,node_modules/**,test/**,"
package.json scripts
```json
"scripts": {
"test": "istanbul cover --report html node_modules/.bin/_mocha -- -t 600000 recursive $(find ./test -path '*.js')",
"cover": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- -u exports -R spec" ,
"cobertura": "./node_modules/.bin/istanbul report --dir ./coverage/report cobertura"
}
According the docs Sonar uses the following model to calculate coverage:
Coverage = (CT + CF + LC)/(2*B + EL)
where
CT = conditions that have been evaluated to ‘true’ at least once
CF = conditions that have been evaluated to ‘false’ at least once
LC = covered lines = linestocover - uncovered_lines
B = total number of conditions
EL = total number of executable lines (lines_to_cover)
Following the formula above, how would fit for the file below
file measures