java - SonarQube 上的激活规则
问题描述
我尝试在 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();
}
}
}
但是当我扫描我的项目机器人时,SonarQube 没有在分析中使用我的规则的问题
解决方案
推荐阅读
- amazon-web-services - 在 AWS 上部署 Golang
- typescript - node_modules/@types/babel _template/index.d.ts :16:28 - 错误 TS2583: 找不到名称 'Set'
- javascript - 为什么我的代码抛出“无法读取未定义的属性'parentNode'”?
- c++ - 使用 Qt QPainter 和 QSvgGenerator 创建的 SVG 裁剪为视口大小
- asp.net-core - 从 .netCore Web 应用程序项目中读取类库项目的程序集版本
- git - git config 设置自动创建同名远程分支
- z3 - 在 Solverfor("QF_LIA") 中使用超时选项时出错
- ios - 如何在长按时取消选择 UITableViewCell?
- node.js - Node.JS、Express 和 MongoDB Atlas:: 多个集合 ejs
- http - 从 Postman 生成 cURL 请求