Source:
<code>private void analyzeFiles(Set<String> fileNames) throws CLIArgumentParserException, IOException { ColorSettings colorSettings = new ColorSettings(configuration.shouldColorOutput(), configuration.shouldInvertColorOutput()); Formatter formatter = configuration.getFormatter(colorSettings); Severity maxSeverity = configuration.getMaxSeverity(); ConstructLengths constructLengths = configuration.parseConstructLengths(); Set<Rules> enabledRules = configuration.getEnabledRules(); <START> setNumberOfFilesBeforePurge(); <END> List<File> files = fileNames.parallelStream().map(File::new).collect(Collectors.toList()); formatter.printProgressInfo( String.format("Analyzing %s:%n", Formatter.pluralize(fileNames.size(), "file", "files"))); files.parallelStream().forEach( file -> { try { Optional<CommonTokenStream> tokenStream = getTokenStream(file); Optional<TopLevelContext> tree = getParseTree(tokenStream); analyzeFile(file, tokenStream, tree, formatter, maxSeverity, constructLengths, enabledRules); formatter.printProgressInfo("."); } catch (ErrorListener.ParseException e) { formatter.printProgressInfo("S"); Printer printer = new Printer(file, maxSeverity, formatter); printer.setShouldPrintParseErrorMessage(true); printersForAllFiles.add(printer); numSkippedFiles.incrementAndGet(); } catch (CLIArgumentParserException e) { handleCLIException(e); } }); formatter.printProgressInfo(String.format("%n")); printersForAllFiles.forEach(printer -> { try { printer.printAllMessages(); } catch (IOException e) { handleIOException(e); } }); formatter.displaySummary(fileNames.size(), numSkippedFiles.get(), numErrors.get(), numWarnings.get()); handleErrorViolations(formatter, numErrors.get()); }</code><technical_language>I this simplified numberOfFilesBeforePurge = configuration.numberOfFilesBeforePurge(); (no need a separate method for it) default 0, semantically identical providing --purge flag</technical_language>

Target:
private void analyzeFiles(Set<String> fileNames) throws CLIArgumentParserException, IOException { ColorSettings colorSettings = new ColorSettings(configuration.shouldColorOutput(), configuration.shouldInvertColorOutput()); Formatter formatter = configuration.getFormatter(colorSettings); Severity maxSeverity = configuration.getMaxSeverity(); ConstructLengths constructLengths = configuration.parseConstructLengths(); Set<Rules> enabledRules = configuration.getEnabledRules(); numberOfFilesBeforePurge = configuration.numberOfFilesBeforePurge(); List<File> files = fileNames.parallelStream().map(File::new).collect(Collectors.toList()); formatter.printProgressInfo( String.format("Analyzing %s:%n", Formatter.pluralize(fileNames.size(), "file", "files"))); files.parallelStream().forEach( file -> { try { Optional<CommonTokenStream> tokenStream = getTokenStream(file); Optional<TopLevelContext> tree = getParseTree(tokenStream); analyzeFile(file, tokenStream, tree, formatter, maxSeverity, constructLengths, enabledRules); formatter.printProgressInfo("."); } catch (ErrorListener.ParseException e) { formatter.printProgressInfo("S"); Printer printer = new Printer(file, maxSeverity, formatter); printer.setShouldPrintParseErrorMessage(true); printersForAllFiles.add(printer); numSkippedFiles.incrementAndGet(); } catch (CLIArgumentParserException e) { handleCLIException(e); } }); formatter.printProgressInfo(String.format("%n")); printersForAllFiles.forEach(printer -> { try { printer.printAllMessages(); } catch (IOException e) { handleIOException(e); } }); formatter.displaySummary(fileNames.size(), numSkippedFiles.get(), numErrors.get(), numWarnings.get()); handleErrorViolations(formatter, numErrors.get()); }