SonarQube上的激活规则

时间:2018-07-31 10:51:44

标签: java sonarqube static-analysis

我尝试在SonarQube和Robotframework语言之间进行集成,所以我用java创建了一个包含创建类的插件,该类与命名为Rflint的工具规则有关:

@Override
public void execute(SensorContext context) {
    FileSystem fs = context.fileSystem();
    Iterable<InputFile> inputFiles = fs.inputFiles(fs.predicates().hasLanguage("Robot"));
    for (InputFile inputFile : inputFiles) {
      // no need to define the severity as it is automatically set according
      // to the configured Quality profile
      NewIssue newIssue = context.newIssue()
        .forRule(RobotRulesDefinition.No_operation)

        // gap is used to estimate the remediation cost to fix the debt
        .gap(ARBITRARY_GAP);


      NewIssueLocation primaryLocation = newIssue.newLocation()
        .on(inputfile)
        .at(inputfile.selectLine(LINE_1))
        .message("You can't do anything. This is first line!");
      newIssue.at(primaryLocation);
      newIssue.save();
    }
  }
}

但是当我扫描我的项目Robot时,SonarQube没有在分析中使用我的规则的问题

0 个答案:

没有答案
相关问题