tasks/code_quality_report.js
function parseCoverageResults(src) {
            var collector = new istanbul.Collector();
            var utils = istanbul.utils;

            var results = [];
            grunt.file.expand({filter: 'isFile'}, src).forEach(function (file) {
                var browser = path.dirname(file).substring(path.dirname(file).lastIndexOf("/")+1)
                collector.add(JSON.parse(grunt.file.read(file)));
                var summary = utils.summarizeCoverage(collector.getFinalCoverage());

                results.push({
                    browser: browser,
                    lines: Number(summary.lines.pct),
                    branches: Number(summary.branches.pct),
                    functions: Number(summary.functions.pct),
                    statements: Number(summary.statements.pct)
                });
            });
            return results;
        }
function parseCoverageResults(src) {
            var collector = new istanbul.Collector();
            var utils = istanbul.utils;

            var results = [];
            grunt.file.expand({filter: 'isFile'}, src).forEach(function (file) {
                var browser = path.dirname(file).substring(path.dirname(file).lastIndexOf("/")+1)
                collector.add(JSON.parse(grunt.file.read(file)));
                var summary = utils.summarizeCoverage(collector.getFinalCoverage());

                results.push({
                    browser: browser,
                    lines: Number(summary.lines.pct),
                    branches: Number(summary.branches.pct),
                    functions: Number(summary.functions.pct),
                    statements: Number(summary.statements.pct)
                });
            });
            return results;
        }
function parseCoverageResults ( src ) { var collector = new istanbul . Collector ( ) ; var utils = istanbul . utils ; var results = [ ] ; grunt . file . expand ( { filter : 'isFile' } , src ) . forEach ( function ( file ) { var browser = path . dirname ( file ) . substring ( path . dirname ( file ) . lastIndexOf ( "/" ) + 1 ) collector . add ( JSON . parse ( grunt . file . read ( file ) ) ) ; var summary = utils . summarizeCoverage ( collector . getFinalCoverage ( ) ) ; results . push ( { browser : browser , lines : Number ( summary . lines . pct ) , branches : Number ( summary . branches . pct ) , functions : Number ( summary . functions . pct ) , statements : Number ( summary . statements . pct ) } ) ; } ) ; return results ; }
Parse the coverage results
@param coverage The coverage location.
@returns {{coverage: {}}}
Parse the coverage results