最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How does SonarQube calculate the overall coverage? - Stack Overflow

programmeradmin1浏览0评论

The image above shows the SonarQube coverage for one of my folders, but if you take the average of the percentages of all files in that folder, it will amount to 49%, yet SonarQube will display 31.4%. If not by taking averages, how does SonarQube calculate the overall coverage? The same is true for all folders, even the top most one.

The image above shows the SonarQube coverage for one of my folders, but if you take the average of the percentages of all files in that folder, it will amount to 49%, yet SonarQube will display 31.4%. If not by taking averages, how does SonarQube calculate the overall coverage? The same is true for all folders, even the top most one.

Share Improve this question asked Mar 8, 2018 at 4:28 m-a-r-c-e-l-i-n-om-a-r-c-e-l-i-n-o 2,6721 gold badge20 silver badges27 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 19

Overall coverage is calculated as

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 = lines_to_cover - uncovered_lines

B = total number of conditions
EL = total number of executable lines (lines_to_cover)

More details can be found in the documentation

发布评论

评论列表(0)

  1. 暂无评论