Java 声纳qube的激活规则
我尝试在SonarQube和Robotframework语言之间进行集成,因此我使用java创建了一个插件,包含与工具nommed Rflint规则相关的创建问题类:Java 声纳qube的激活规则,java,sonarqube,static-analysis,Java,Sonarqube,Static Analysis,我尝试在SonarQube和Robotframework语言之间进行集成,因此我使用java创建了一个插件,包含与工具nommed Rflint规则相关的创建问题类: @Override public void execute(SensorContext context) { FileSystem fs = context.fileSystem(); Iterable<InputFile> inputFiles = fs.inputFiles(fs.predicate
@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();
}
}
}
@覆盖
public void execute(传感器上下文){
FileSystem fs=context.FileSystem();
Iterable inputFiles=fs.inputFiles(fs.predicates().hasLanguage(“Robot”);
用于(输入文件输入文件:输入文件){
//无需定义严重性,因为它是根据
//到配置的质量配置文件
NewIssue NewIssue=context.NewIssue()
.forRule(机器人规则定义。无操作)
//gap用于估算修复债务的修复成本
.间隙(任意间隙);
NewIssueLocation primaryLocation=newIssue.newLocation()
.on(输入文件)
.at(inputfile.selectLine(第1行))
.message(“您不能做任何事情。这是第一行!”);
新发行。at(主要位置);
newIssue.save();
}
}
}
但问题是,当我扫描我的项目机器人时,SonarQube没有在分析中使用我的规则