code: private int verifyRuleResults(Collection<? extends Result<? extends ExecutableRule>> results, Severity warnOnSeverity, Severity failOnSeverity, String type,
              String header, boolean logResult) {
          int violations = 0;
          for (Result<?> result : results) {
              if (Result.Status.FAILURE.equals(result.getStatus())) {
                  ExecutableRule rule = result.getRule();
                  String severityInfo = rule.getSeverity().getInfo(result.getSeverity());
                  List<String> resultRows = getResultRows(result, logResult);
                  // violation severity level check
                  boolean warn = warnOnSeverity != null && result.getSeverity().getLevel() <= warnOnSeverity.getLevel();
                  boolean fail = failOnSeverity != null && result.getSeverity().getLevel() <= failOnSeverity.getLevel();
                  LoggingStrategy loggingStrategy;
                  if (fail) {
                      violations++;
                      loggingStrategy = errorLogger;
                  } else if (warn) {
                      loggingStrategy = warnLogger;
                  } else {
                      loggingStrategy = debugLogger;
                  }
                  log(loggingStrategy, rule, resultRows, severityInfo, type, header);
              }
          }
          return violations;
      }
docs: Verifies the given results and logs messages.
  
  @param results
  The collection of results to verify.
  @param warnOnSeverity
  The severity threshold to warn.
  @param failOnSeverity
  The severity threshold to fail.
  @param type
  The type of the rules (as string).
  @param header
  The header to use.
  @param logResult
  if `true` log the result of the executable rule.
  @return The number of detected violations.