@Test public void should_save_issue() throws Exception { inputFile("file.js"); ActiveRules activeRules = (new ActiveRulesBuilder()) .addRule(new NewActiveRule.Builder() .setRuleKey(RuleKey.of(CheckList.JS_REPOSITORY_KEY, "S1314")) .build()) .build(); checkFactory = new CheckFactory(activeRules); createSensor().execute(context); Collection<Issue> issues = context.allIssues(); assertThat(issues).hasSize(1); assertThat(logTester.logs(LoggerLevel.WARN)).doesNotContain("SonarJS custom rules usage is deprecated. Consider using ESlint custom rules instead"); }
public void execute(SensorContext context) { checkDeprecatedEslintProperty(context); List<TreeVisitor> treeVisitors = new ArrayList<>(); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.addAll(checks.visitorChecks()); Iterable<InputFile> inputFiles = getInputFiles(context); Collection<String> files = StreamSupport.stream(inputFiles.spliterator(), false) .map(InputFile::toString) .collect(Collectors.toList()); ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(files); analyseFiles(context, treeVisitors, inputFiles, progressReport); }
JavaScriptSensor { public void execute(SensorContext context) { checkDeprecatedEslintProperty(context); List<TreeVisitor> treeVisitors = new ArrayList<>(); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.addAll(checks.visitorChecks()); Iterable<InputFile> inputFiles = getInputFiles(context); Collection<String> files = StreamSupport.stream(inputFiles.spliterator(), false) .map(InputFile::toString) .collect(Collectors.toList()); ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(files); analyseFiles(context, treeVisitors, inputFiles, progressReport); } }
JavaScriptSensor { public void execute(SensorContext context) { checkDeprecatedEslintProperty(context); List<TreeVisitor> treeVisitors = new ArrayList<>(); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.addAll(checks.visitorChecks()); Iterable<InputFile> inputFiles = getInputFiles(context); Collection<String> files = StreamSupport.stream(inputFiles.spliterator(), false) .map(InputFile::toString) .collect(Collectors.toList()); ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(files); analyseFiles(context, treeVisitors, inputFiles, progressReport); } JavaScriptSensor(AbstractChecks checks); }
JavaScriptSensor { public void execute(SensorContext context) { checkDeprecatedEslintProperty(context); List<TreeVisitor> treeVisitors = new ArrayList<>(); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.addAll(checks.visitorChecks()); Iterable<InputFile> inputFiles = getInputFiles(context); Collection<String> files = StreamSupport.stream(inputFiles.spliterator(), false) .map(InputFile::toString) .collect(Collectors.toList()); ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(files); analyseFiles(context, treeVisitors, inputFiles, progressReport); } JavaScriptSensor(AbstractChecks checks); void execute(SensorContext context); }
JavaScriptSensor { public void execute(SensorContext context) { checkDeprecatedEslintProperty(context); List<TreeVisitor> treeVisitors = new ArrayList<>(); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.addAll(checks.visitorChecks()); Iterable<InputFile> inputFiles = getInputFiles(context); Collection<String> files = StreamSupport.stream(inputFiles.spliterator(), false) .map(InputFile::toString) .collect(Collectors.toList()); ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(files); analyseFiles(context, treeVisitors, inputFiles, progressReport); } JavaScriptSensor(AbstractChecks checks); void execute(SensorContext context);  }