【问题标题】:How to solve "Add or update the header of this file." code smell in SonarQube?如何解决“添加或更新此文件的标题”。 SonarQube 中的代码异味?
【发布时间】:2018-09-23 13:51:02
【问题描述】:

我什至尝试过给出的“合规解决方案”:

/*
 * SonarQube, open source software quality management tool.
 * Copyright (C) 2008-2013 SonarSource
 * mailto:contact AT sonarsource DOT com
 *
 * SonarQube is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * SonarQube is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

但这并不能解决代码异味。你能给我一个可以解决这个问题的最简单的例子吗?

【问题讨论】:

    标签: sonarqube


    【解决方案1】:

    当该规则被添加到应用到您的项目的配置文件时,该规则将使用预期的标头进行配置。您应该检查的不是“合规解决方案”,而是该配置以查看预期结果。

    请注意,标头可以配置为正则表达式。通常这用于处理版权年份的变化,但您应该仔细检查它是否也被用作正则表达式。

    【讨论】:

      猜你喜欢
      • 2021-12-11
      • 2020-09-28
      • 2019-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-18
      • 2011-12-22
      • 1970-01-01
      相关资源
      最近更新 更多