test_class.declarator: LOGGER = LoggerFactory.getLogger(CommandTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(CommandTest.class);
test_class.type: Logger
test_class.var_name: LOGGER
test_class.declarator: testOutputBaseDir = new File("target/test-output/CommandTest")
test_class.modifier: final
test_class.original_string: final File testOutputBaseDir = new File("target/test-output/CommandTest");
test_class.type: File
test_class.var_name: testOutputBaseDir
test_class.file: cli/src/test/java/net/adamcin/oakpal/cli/CommandTest.java
test_class.identifier: CommandTest
test_case.body: @Test
      public void testGetHighestReportSeverity() {
          ReportCollector collector1 = new ReportCollector();
          collector1.reportViolation(new SimpleViolation(Severity.MINOR, ""));
          collector1.reportViolation(new SimpleViolation(Severity.MAJOR, ""));
          CheckReport hasMajor = new SimpleReport("hasMajor", collector1.getReportedViolations());
          ReportCollector collector2 = new ReportCollector();
          collector2.reportViolation(new SimpleViolation(Severity.MINOR, ""));
          collector2.reportViolation(new SimpleViolation(Severity.SEVERE, ""));
          CheckReport hasSevere = new SimpleReport("hasSevere", collector2.getReportedViolations());
          ReportCollector collector3 = new ReportCollector();
          collector3.reportViolation(new SimpleViolation(Severity.MINOR, ""));
          CheckReport hasMinor = new SimpleReport("hasMinor", collector3.getReportedViolations());
          final Console console = getMockConsole();
          Options optsFailDefault = new Options.Builder()
                  .build(console).getOrDefault(null);
          Options optsFailMinor = new Options.Builder()
                  .setFailOnSeverity(Severity.MINOR)
                  .build(console).getOrDefault(null);
          Options optsFailMajor = new Options.Builder()
                  .setFailOnSeverity(Severity.MAJOR)
                  .build(console).getOrDefault(null);
          Options optsFailSevere = new Options.Builder()
                  .setFailOnSeverity(Severity.SEVERE)
                  .build(console).getOrDefault(null);
          final Command command = new Command();
          assertFalse("no exit minor default fail",
                  command.getHighestReportSeverity(optsFailDefault, Collections.singletonList(hasMinor)).isPresent());
          assertEquals("major exit default fail", Command.EXIT_MAJOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailDefault, Collections.singletonList(hasMajor)).get());
          assertEquals("severe exit default fail", Command.EXIT_SEVERE_VIOLATION,
                  command.getHighestReportSeverity(optsFailDefault, Collections.singletonList(hasSevere)).get());
  
          assertEquals("minor exit minor fail", Command.EXIT_MINOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailMinor, Collections.singletonList(hasMinor)).get());
          assertEquals("major exit minor fail", Command.EXIT_MAJOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailMinor, Collections.singletonList(hasMajor)).get());
          assertEquals("severe exit minor fail", Command.EXIT_SEVERE_VIOLATION,
                  command.getHighestReportSeverity(optsFailMinor, Collections.singletonList(hasSevere)).get());
  
          assertFalse("no exit minor major fail",
                  command.getHighestReportSeverity(optsFailMajor, Collections.singletonList(hasMinor)).isPresent());
          assertEquals("major exit major fail", Command.EXIT_MAJOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailMajor, Collections.singletonList(hasMajor)).get());
          assertEquals("severe exit major fail", Command.EXIT_SEVERE_VIOLATION,
                  command.getHighestReportSeverity(optsFailMajor, Collections.singletonList(hasSevere)).get());
  
          assertFalse("no exit minor severe fail",
                  command.getHighestReportSeverity(optsFailSevere, Collections.singletonList(hasMinor)).isPresent());
          assertFalse("no exit major severe fail",
                  command.getHighestReportSeverity(optsFailSevere, Collections.singletonList(hasMajor)).isPresent());
          assertEquals("severe exit major fail", Command.EXIT_SEVERE_VIOLATION,
                  command.getHighestReportSeverity(optsFailSevere, Collections.singletonList(hasSevere)).get());
  
          assertFalse("no exit minor default fail",
                  command.getHighestReportSeverity(optsFailDefault, Arrays.asList(hasMinor, hasMinor)).isPresent());
          assertEquals("minor exit", Command.EXIT_MAJOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailDefault, Arrays.asList(hasMinor, hasMajor)).get());
          assertEquals("major exit", Command.EXIT_MAJOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailDefault, Arrays.asList(hasMajor, hasMinor)).get());
          assertEquals("major exit", Command.EXIT_MAJOR_VIOLATION,
                  command.getHighestReportSeverity(optsFailDefault, Arrays.asList(hasMajor, hasMajor)).get());
          assertEquals("severe exit", Command.EXIT_SEVERE_VIOLATION,
                  command.getHighestReportSeverity(optsFailDefault, Arrays.asList(hasSevere, hasMajor)).get());
      }
test_case.class_method_signature: CommandTest.testGetHighestReportSeverity()
test_case.full_signature: @Test public void testGetHighestReportSeverity()
test_case.identifier: testGetHighestReportSeverity
test_case.invocations: reportViolation reportViolation getReportedViolations reportViolation reportViolation getReportedViolations reportViolation getReportedViolations getMockConsole getOrDefault build getOrDefault build setFailOnSeverity getOrDefault build setFailOnSeverity getOrDefault build setFailOnSeverity assertFalse isPresent getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertFalse isPresent getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertFalse isPresent getHighestReportSeverity singletonList assertFalse isPresent getHighestReportSeverity singletonList assertEquals get getHighestReportSeverity singletonList assertFalse isPresent getHighestReportSeverity asList assertEquals get getHighestReportSeverity asList assertEquals get getHighestReportSeverity asList assertEquals get getHighestReportSeverity asList assertEquals get getHighestReportSeverity asList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetHighestReportSeverity()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(Command.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(Command.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: SHORT_NO_OPT_PREFIX = "+"
focal_class.modifier: private static final
focal_class.original_string: private static final String SHORT_NO_OPT_PREFIX = "+";
focal_class.type: String
focal_class.var_name: SHORT_NO_OPT_PREFIX
focal_class.declarator: LONG_NO_OPT_PREFIX = "--no-"
focal_class.modifier: private static final
focal_class.original_string: private static final String LONG_NO_OPT_PREFIX = "--no-";
focal_class.type: String
focal_class.var_name: LONG_NO_OPT_PREFIX
focal_class.declarator: VERSION_PROPERTIES_NAME = "version.properties"
focal_class.modifier: private static final
focal_class.original_string: private static final String VERSION_PROPERTIES_NAME = "version.properties";
focal_class.type: String
focal_class.var_name: VERSION_PROPERTIES_NAME
focal_class.declarator: COMMAND_HELP_TXT = "help.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String COMMAND_HELP_TXT = "help.txt";
focal_class.type: String
focal_class.var_name: COMMAND_HELP_TXT
focal_class.declarator: EXIT_GENERAL_ERROR = 1
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_GENERAL_ERROR = 1;
focal_class.type: Integer
focal_class.var_name: EXIT_GENERAL_ERROR
focal_class.declarator: EXIT_ABORTED_SCAN = 9
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_ABORTED_SCAN = 9;
focal_class.type: Integer
focal_class.var_name: EXIT_ABORTED_SCAN
focal_class.declarator: EXIT_SEVERE_VIOLATION = 10
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_SEVERE_VIOLATION = 10;
focal_class.type: Integer
focal_class.var_name: EXIT_SEVERE_VIOLATION
focal_class.declarator: EXIT_MAJOR_VIOLATION = 11
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_MAJOR_VIOLATION = 11;
focal_class.type: Integer
focal_class.var_name: EXIT_MAJOR_VIOLATION
focal_class.declarator: EXIT_MINOR_VIOLATION = 12
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_MINOR_VIOLATION = 12;
focal_class.type: Integer
focal_class.var_name: EXIT_MINOR_VIOLATION
focal_class.file: cli/src/main/java/net/adamcin/oakpal/cli/Command.java
focal_class.identifier: Command
focal_class.class_method_signature: Command.perform(final @NotNull Console console, final @NotNull String[] args)
focal_class.full_signature:  IO<Integer> perform(final @NotNull Console console, final @NotNull String[] args)
focal_class.identifier: perform
focal_class.parameters: (final @NotNull Console console, final @NotNull String[] args)
focal_class.return: IO<Integer>
focal_class.signature: IO<Integer> perform(final @NotNull Console console, final @NotNull String[] args)
focal_class.class_method_signature: Command.getNodeStoreSupplier(final @NotNull Options opts)
focal_class.full_signature:  Supplier<NodeStore> getNodeStoreSupplier(final @NotNull Options opts)
focal_class.identifier: getNodeStoreSupplier
focal_class.parameters: (final @NotNull Options opts)
focal_class.return: Supplier<NodeStore>
focal_class.signature: Supplier<NodeStore> getNodeStoreSupplier(final @NotNull Options opts)
focal_class.class_method_signature: Command.doScan(final @NotNull Console console, final @NotNull Options opts)
focal_class.full_signature:  IO<Integer> doScan(final @NotNull Console console, final @NotNull Options opts)
focal_class.identifier: doScan
focal_class.parameters: (final @NotNull Console console, final @NotNull Options opts)
focal_class.return: IO<Integer>
focal_class.signature: IO<Integer> doScan(final @NotNull Console console, final @NotNull Options opts)
focal_class.class_method_signature: Command.runOakScan(final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.full_signature:  Result<List<CheckReport>> runOakScan(final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.identifier: runOakScan
focal_class.parameters: (final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.return: Result<List<CheckReport>>
focal_class.signature: Result<List<CheckReport>> runOakScan(final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.class_method_signature: Command.getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.full_signature:  Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.identifier: getHighestReportSeverity
focal_class.parameters: (final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.return: Optional<Integer>
focal_class.signature: Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.class_method_signature: Command.printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.full_signature:  IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.identifier: printReports
focal_class.parameters: (final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.return: IO<Nothing>
focal_class.signature: IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.class_method_signature: Command.printHelp(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.full_signature:  IO<Nothing> printHelp(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.identifier: printHelp
focal_class.parameters: (final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.return: IO<Nothing>
focal_class.signature: IO<Nothing> printHelp(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.class_method_signature: Command.printVersion(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.full_signature:  IO<Nothing> printVersion(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.identifier: printVersion
focal_class.parameters: (final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.return: IO<Nothing>
focal_class.signature: IO<Nothing> printVersion(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.class_method_signature: Command.flipOpt(final @NotNull String wholeOpt)
focal_class.full_signature:  Optional<String> flipOpt(final @NotNull String wholeOpt)
focal_class.identifier: flipOpt
focal_class.parameters: (final @NotNull String wholeOpt)
focal_class.return: Optional<String>
focal_class.signature: Optional<String> flipOpt(final @NotNull String wholeOpt)
focal_class.class_method_signature: Command.parseArgs(final @NotNull Console console, final @NotNull String[] args)
focal_class.full_signature: @NotNull Result<Options> parseArgs(final @NotNull Console console, final @NotNull String[] args)
focal_class.identifier: parseArgs
focal_class.modifiers: @NotNull
focal_class.parameters: (final @NotNull Console console, final @NotNull String[] args)
focal_class.return: Result<Options>
focal_class.signature: Result<Options> parseArgs(final @NotNull Console console, final @NotNull String[] args)
focal_method.body: Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports) {
          return reports.stream()
                  .flatMap(compose1(CheckReport::getViolations, Collection::stream))
                  .map(Violation::getSeverity)
                  .reduce(Severity::maxSeverity)
                  .filter(opts.getFailOnSeverity().meetsMinimumSeverity())
                  .map(severity -> {
                      switch (severity) {
                          case SEVERE:
                              return EXIT_SEVERE_VIOLATION;
                          case MAJOR:
                              return EXIT_MAJOR_VIOLATION;
                          case MINOR:
                          default:
                              return EXIT_MINOR_VIOLATION;
                      }
                  });
      }
focal_method.class_method_signature: Command.getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_method.full_signature:  Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_method.identifier: getHighestReportSeverity
focal_method.invocations: map filter reduce map flatMap stream compose1 meetsMinimumSeverity getFailOnSeverity
focal_method.parameters: (final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_method.return: Optional<Integer>
focal_method.signature: Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)