Package org.codenarc.results

Examples of org.codenarc.results.DirectoryResults


     * @param ruleSet - the RuleSet to apply to each source component; must not be null.
     * @return the results from applying the RuleSet to all of the source
     */
    public Results analyze(RuleSet ruleSet) {
        long startTime = System.currentTimeMillis();
        DirectoryResults reportResults = new DirectoryResults();

        int numThreads = Runtime.getRuntime().availableProcessors() + 1;
        ExecutorService pool = Executors.newFixedThreadPool(numThreads);

        for (FileSet fileSet : fileSets) {
View Full Code Here


        String parentPath = PathUtil.getParentPath(results.getPath());
        if (parentPath == null) {
            reportResults.addChild(results);
            return;
        }
        DirectoryResults parent = (DirectoryResults) reportResults.findResultsForPath(parentPath);
        if (parent == null) {
            parent = new DirectoryResults(parentPath);
            addToParentResults(reportResults, parent);
        }
        parent.addChild(results);
    }
View Full Code Here

        Set<String> set = resultsMap.keySet();
        ArrayList<String> allPaths = new ArrayList<String>(set);
        Collections.sort(allPaths);

        for (String path : allPaths) {
            DirectoryResults dirResults = new DirectoryResults(path);
            List<FileResults> allResults = resultsMap.get(path);
            Collections.sort(allResults, new Comparator<FileResults>() {
                public int compare(FileResults o1, FileResults o2) {
                    return o1.getPath().compareTo(o2.getPath());
                }
            });

            for (FileResults child : allResults) {
                dirResults.addChild(child);
            }
            AtomicInteger cnt = fileCountMap.get(path);
            dirResults.setNumberOfFilesInThisDirectory(cnt != null ? cnt.get() : 0);
            addToParentResults(reportResults, dirResults);
        }
    }
View Full Code Here

TOP

Related Classes of org.codenarc.results.DirectoryResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.