class TaskScanner {

    public Report scan(final Path file, final Charset charset) {
        try (Stream<String> lines = Files.lines(file, charset)) {
            return scanTasks(lines.iterator(), new IssueBuilder().setFileName(file.toString()));
        }
        catch (IOException | UncheckedIOException exception) {
            Report report = new Report();
            Throwable cause = exception.getCause();
            if (cause instanceof MalformedInputException || cause instanceof UnmappableCharacterException) {
                report.logError("Can't read source file '%s', defined encoding '%s' seems to be wrong",
                        file, charset);
            }
            else {
                report.logException(exception, "Exception while reading the source code file '%s':", file);
            }

            return report;
        }
    }

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

}