@VisibleForTesting protected void analyseFiles( SensorContext context, List<TreeVisitor> treeVisitors, Iterable<InputFile> inputFiles, ProgressReport progressReport) { boolean success = false; try { for (InputFile inputFile : inputFiles) { // check for cancellation of the analysis (by SonarQube or SonarLint). See SONARJS-761. if (context.getSonarQubeVersion().isGreaterThanOrEqual(V6_0) && context.isCancelled()) { throw new CancellationException( "Analysis interrupted because the SensorContext is in cancelled state"); } if (!isExcluded(inputFile.file())) { analyse(context, inputFile, treeVisitors); } progressReport.nextFile(); } success = true; } catch (CancellationException e) { // do not propagate the exception LOG.debug(e.toString()); } finally { stopProgressReport(progressReport, success); } }