<tfoot id='PTUPP'></tfoot>
  1. <i id='PTUPP'><tr id='PTUPP'><dt id='PTUPP'><q id='PTUPP'><span id='PTUPP'><b id='PTUPP'><form id='PTUPP'><ins id='PTUPP'></ins><ul id='PTUPP'></ul><sub id='PTUPP'></sub></form><legend id='PTUPP'></legend><bdo id='PTUPP'><pre id='PTUPP'><center id='PTUPP'></center></pre></bdo></b><th id='PTUPP'></th></span></q></dt></tr></i><div id='PTUPP'><tfoot id='PTUPP'></tfoot><dl id='PTUPP'><fieldset id='PTUPP'></fieldset></dl></div>

  2. <legend id='PTUPP'><style id='PTUPP'><dir id='PTUPP'><q id='PTUPP'></q></dir></style></legend>
        <bdo id='PTUPP'></bdo><ul id='PTUPP'></ul>
    1. <small id='PTUPP'></small><noframes id='PTUPP'>

      @SuppressWarnings 的 Javascript 等价物?

      Javascript equivalent of @SuppressWarnings?(@SuppressWarnings 的 Javascript 等价物?)
    2. <small id='YFzqV'></small><noframes id='YFzqV'>

      <tfoot id='YFzqV'></tfoot>
        <tbody id='YFzqV'></tbody>
        <bdo id='YFzqV'></bdo><ul id='YFzqV'></ul>

          • <i id='YFzqV'><tr id='YFzqV'><dt id='YFzqV'><q id='YFzqV'><span id='YFzqV'><b id='YFzqV'><form id='YFzqV'><ins id='YFzqV'></ins><ul id='YFzqV'></ul><sub id='YFzqV'></sub></form><legend id='YFzqV'></legend><bdo id='YFzqV'><pre id='YFzqV'><center id='YFzqV'></center></pre></bdo></b><th id='YFzqV'></th></span></q></dt></tr></i><div id='YFzqV'><tfoot id='YFzqV'></tfoot><dl id='YFzqV'><fieldset id='YFzqV'></fieldset></dl></div>
            <legend id='YFzqV'><style id='YFzqV'><dir id='YFzqV'><q id='YFzqV'></q></dir></style></legend>
              • 本文介绍了@SuppressWarnings 的 Javascript 等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我目前正在运行 Sonar 以对我的代码进行静态分析.当我分析 java 文件并想抑制某个警告时,我使用了 @SuppressWarnings(nameOfTheWarningOnSonar) 注释.我想知道 Javascript 中是否有一个简单的等价物来抑制 Sonar 上的特定警告.

                I am currently running Sonar for the static analysis of my code. When I was analyzing java files and wanted to suppress a certain warning, I used the @SuppressWarnings(nameOfTheWarningOnSonar) annotation. I wanted to know if there was a simple equivalent in Javascript to suppress specific warnings on Sonar.

                推荐答案

                嗯,最简单的方法是肯定的:

                Well, the easiest way is for sure :

                纠正 Sonar 所说的内容 :)

                但让我们假设它是误报.

                but let's assume that it's false positive.

                以下是解决此问题的可能方法列表:

                Here are the list of possible method to fix this issue :

                自 2014 年 11 月起: 标签支持

                // NOSONAR
                the code who display Sonar error
                

                现在完全支持 JavaScript 检查(感谢@RPallas)

                is now fully supported by the JavaScript check (thanks @RPallas)

                当你不控制声纳时: 相当丑陋的方法

                try {
                
                  the code who display Sonar error     
                
                } catch(err) { }
                

                如果您发现任何可能的问题,Sonar 将无法检测到某些东西(感谢 @JavaScript).

                If you catch any possible problem, Sonar can't detect something (thanks @JavaScript).

                但最好的办法是一定要修改声纳的配置:

                But the best way is for sure to modify the configuration of Sonar :

                当您控制 Sonar 时: 添加插件

                在 Sonar 上使用 CheckStyle 插件:(http://checkstyle.sourceforge.net/)

                To use the CheckStyle plugin on Sonar : (http://checkstyle.sourceforge.net/)

                解决方案是向违规类添加 Checkstyle 结构化注释以禁止特定检查.

                The solution will be to add a Checkstyle structured comment to the offending class to suppress a particular check.

                需要的抑制评论(SuppressionCommentFilter)格式是这样的:

                The suppression comment (SuppressionCommentFilter) format required is like this:

                //CHECKSTYLE:OFF
                
                     the code who display Sonar error    
                
                //CHECKSTYLE:ON
                

                但是我把你送到这个插件的文档(http://checkstyle.sourceforge.net/config.html)

                But I send you to the documentation of this plugin (http://checkstyle.sourceforge.net/config.html)

                我希望这个答案会有所帮助.

                I hope this answer helps.

                这篇关于@SuppressWarnings 的 Javascript 等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                quot;Status Code:200 OK (from ServiceWorker)quot; in Chrome Network DevTools?(“状态码:200 OK(来自 ServiceWorker)在 Chrome 网络开发工具中?)
                How to set a header for a HTTP GET request, and trigger file download?(如何为 HTTP GET 请求设置标头并触发文件下载?)
                Adding custom HTTP headers using JavaScript(使用 JavaScript 添加自定义 HTTP 标头)
                SQL Query DocumentDB in Azure Functions by an integer not working(通过整数在 Azure Functions 中 SQL 查询 DocumentDB 不起作用)
                Azure Functions [JavaScript / Node.js] - HTTP call, good practices(Azure Functions [JavaScript/Node.js] - HTTP 调用,良好实践)
                Azure Functions - Import Custom Node Module(Azure Functions - 导入自定义节点模块)
                  <tbody id='wkVlP'></tbody>

                      • <bdo id='wkVlP'></bdo><ul id='wkVlP'></ul>

                          <small id='wkVlP'></small><noframes id='wkVlP'>

                          <legend id='wkVlP'><style id='wkVlP'><dir id='wkVlP'><q id='wkVlP'></q></dir></style></legend>
                          <tfoot id='wkVlP'></tfoot>

                        • <i id='wkVlP'><tr id='wkVlP'><dt id='wkVlP'><q id='wkVlP'><span id='wkVlP'><b id='wkVlP'><form id='wkVlP'><ins id='wkVlP'></ins><ul id='wkVlP'></ul><sub id='wkVlP'></sub></form><legend id='wkVlP'></legend><bdo id='wkVlP'><pre id='wkVlP'><center id='wkVlP'></center></pre></bdo></b><th id='wkVlP'></th></span></q></dt></tr></i><div id='wkVlP'><tfoot id='wkVlP'></tfoot><dl id='wkVlP'><fieldset id='wkVlP'></fieldset></dl></div>