【问题标题】:Bypass SonarQube naming convention rule for Application_ methods in Global.asax绕过 Global.asax 中 Application_ 方法的 SonarQube 命名约定规则
【发布时间】:2015-04-23 07:36:50
【问题描述】:

有什么办法可以绕过规则

"Rename this method to match the regular expression: [A-Z][a-zA-Z0-9]++"

对于 Global.asax.cs,特别是对于 Application_ 方法/事件?我们不想尽量减少完全跳过的文件数量。

public class MvcApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {

【问题讨论】:

    标签: sonarqube global-asax application-start


    【解决方案1】:

    您可以在这个确切的文件上为此规则定义一个狭窄的exclusion pattern,请按照 SonarQube 手册中的说明进行操作。

    【讨论】:

    • 谢谢!所以尽可能接近文件级别,对吗?无法排除文件中的特定模式,除非通过使用 ignoring start 和 end 块将它们内联忽略。
    • 很遗憾,Sonar 不接受我的模式。 Ruley 键模式:squid:S00100 / 文件路径模式:**/Global.asax.cs。我还尝试将 **/**/Global.asax.cs 作为文件模式。
    猜你喜欢
    • 2013-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    • 2021-12-28
    • 1970-01-01
    • 2019-04-23
    • 2013-03-11
    相关资源
    最近更新 更多