How to ignore some statements in Javascript code coverage when using lcov and istanbul ?
1,402 views
Skip to first unread message
anthony....@gmail.com
unread,
Jul 31, 2015, 3:51:11 AM7/31/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SonarQube
How is it possible to make sonarqube take into account directives found in code comments ? There is a page on istanbul describing how to ignore some branches using comments like this
/* istanbul ignore if */if (hardToReproduceError)) {
return callback(hardToReproduceError);
}
It works well into HTML reports generated by istanbul but it does not work with Sonarqube.
G. Ann Campbell
unread,
Jul 31, 2015, 12:36:08 PM7/31/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SonarQube, anthony....@gmail.com
Hi Anthony,
The only thing that's available regarding comments is //NOSONAR, which will suppress issues but not affect other metrics. And it's really an antipattern.