class TaskScanner {

    Report scanTasks(final Iterator<String> lines, final IssueBuilder builder) {
        Report report = new Report();

        if (isPatternInvalid) {
            report.logError("%s", errors.toString());
            return report;
        }

        for (int lineNumber = 1; lines.hasNext(); lineNumber++) {
            String line = lines.next();

            for (Severity severity : Severity.getPredefinedValues()) {
                if (patterns.containsKey(severity)) {
                    Matcher matcher = patterns.get(severity).matcher(line);
                    if (matcher.matches() && matcher.groupCount() == 2) {
                        String message = matcher.group(2).trim();
                        builder.setMessage(StringUtils.removeStart(message, ":").trim());

                        String tag = matcher.group(1);
                        if (isUppercase) {
                            builder.setType(StringUtils.upperCase(tag));
                        }
                        else {
                            builder.setType(tag);
                        }
                        report.add(builder.setSeverity(severity).setLineStart(lineNumber).build());
                    }
                }
            }
        }
        return report;
    }

      TaskScanner(final @CheckForNull String highTags, final @CheckForNull String normalTags,
            final @CheckForNull String lowTags,
            final CaseMode caseMode, final MatcherMode matcherMode);

}