Files.walkTree is causing Assignment Branch Condition too high My code is working correctly, but is resulting in a "Assignment branch condition too high" warning with a score of 12.08 on CodeBeat. 

Codebeat is an automated code review utility that helps developers write clean code. I have been using it lately in order to monitor the quality of my code since clean code is being a necessity in today's word. Codebeat calculates the complexity of the code written and assigns a score, so it seems that the complexity of this method seems a bit high that usual. I would be grateful if someone can tell me what is complex about this method.

private void populateDictionary() {
    try {
        Files.walkFileTree(Paths.get(rootDirectory.getCanonicalPath()), EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor&lt;Path&gt;() {
            @Override
            public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException {
                addToDictionary(path);
                return FileVisitResult.CONTINUE;
            }
        });
    }catch(IOException e) {
        System.out.println(e.getMessage());
    }
    System.out.println(this.indexedFileContents.keySet().size() + " files read in directory " + this.rootDirectory);
}


Can anyone tell me what am I doing wrong and how I can improve my code?
Thanks in advance.
Well I figured out a way to refactor my code, and obtained a non-complex code by creating a method that returns the visitor named getSimpleFileVisitor(). I also created another method that will allow me to print the results that I named printFinalResults(). I have also refactored the method's name to walkFileTree().
Maybe my question was a little bit ambiguous, sorry for any inconvenience.

private void walkFileTree() {
    try{
        Files.walkFileTree(Paths.get(rootDirectory.getCanonicalPath()), EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, getSimpleFileVisitor());
    }catch(IOException e) {
        System.out.println(e.getMessage());
    }
    printFinalResults();
}

private SimpleFileVisitor&lt;Path&gt; getSimpleFileVisitor(){
    SimpleFileVisitor&lt;Path&gt; simpleFileVisitor = new SimpleFileVisitor&lt;Path&gt;() {
        @Override
        public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException {
            addToDictionary(path);
            return FileVisitResult.CONTINUE;
        }
    };
    return simpleFileVisitor;
}

private void printFinalResults() {
    System.out.println(this.indexedFileContents.keySet().size() + " files read in directory " + this.rootDirectory);
}