SonarQube JavaScript disable a part of code

末鹿安然 提交于 2020-02-08 03:17:27

问题


I would like to disable a block of code(say a function) in a file for analysis by SonarQube... Any suggestions on how to do that..

I found something for java here --> Turning Sonar off for certain code


回答1:


As far as I know Sonar respects // NOSONAR tag for Java projects but it looks like that is also has been implemented for JS: https://jira.sonarsource.com/browse/SONARJS-294




回答2:


SonarQube provides plenty of options for ignoring issues in specific files and/or code blocks, see Narrowing the Focus documentation (and to your specific case: look for Ignore Issues in Blocks).



来源:https://stackoverflow.com/questions/38991670/sonarqube-javascript-disable-a-part-of-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!