use of org.sonar.api.batch.fs.FilePredicates in project sonarqube by SonarSource.
the class OneBugIssuePerTestLineSensor method analyse.
private void analyse(SensorContext context, String language, String repo) {
FileSystem fs = context.fileSystem();
FilePredicates p = fs.predicates();
for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(language), p.hasType(Type.TEST)))) {
createIssues(file, context, repo);
}
}
use of org.sonar.api.batch.fs.FilePredicates in project sonarqube by SonarSource.
the class OneCodeSmellIssuePerTestLineSensor method analyse.
private void analyse(SensorContext context, String language, String repo) {
FileSystem fs = context.fileSystem();
FilePredicates p = fs.predicates();
for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(language), p.hasType(Type.TEST)))) {
createIssues(file, context, repo);
}
}
use of org.sonar.api.batch.fs.FilePredicates in project sonarqube by SonarSource.
the class OneExternalIssuePerLineSensor method execute.
@Override
public void execute(SensorContext context) {
FileSystem fs = context.fileSystem();
FilePredicates p = fs.predicates();
for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(InputFile.Type.MAIN)))) {
createIssues(file, context);
}
if (context.config().getBoolean(REGISTER_AD_HOC_RULE).orElse(false)) {
context.newAdHocRule().engineId(ENGINE_ID).ruleId(RULE_ID).name("An ad hoc rule").description("blah blah").severity(Severity.BLOCKER).type(RuleType.BUG).save();
}
}
use of org.sonar.api.batch.fs.FilePredicates in project sonarqube by SonarSource.
the class OneExternalIssuePerLineWithoutMessageSensor method execute.
@Override
public void execute(SensorContext context) {
FileSystem fs = context.fileSystem();
FilePredicates p = fs.predicates();
for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(InputFile.Type.MAIN)))) {
createIssues(file, context);
}
if (context.config().getBoolean(REGISTER_AD_HOC_RULE).orElse(false)) {
context.newAdHocRule().engineId(ENGINE_ID).ruleId(RULE_ID).name("An ad hoc rule").description("blah blah").severity(Severity.BLOCKER).type(RuleType.BUG).save();
}
}
use of org.sonar.api.batch.fs.FilePredicates in project sonarqube by SonarSource.
the class OnePredefinedAndAdHocRuleExternalIssuePerLineSensor method execute.
@Override
public void execute(SensorContext context) {
FileSystem fs = context.fileSystem();
FilePredicates p = fs.predicates();
for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(Type.MAIN)))) {
createIssues(file, context);
}
}
Aggregations