/* Copyright 2012-2015, Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ /*jshint maxlen: 300 */ var fs = require('fs'), path = require('path'), handlebars = require('handlebars').create(), annotator = require('./annotator'), helpers = require('./helpers'), templateFor = function (name) { return handlebars.compile(fs.readFileSync(path.resolve(__dirname, 'templates', name + '.txt'), 'utf8')); }, headerTemplate = templateFor('head'), footerTemplate = templateFor('foot'), detailTemplate = handlebars.compile([ '
{{#show_code annotatedCode}}{{/show_code}}
File | ', '', ' | Statements | ', '', ' | Branches | ', '', ' | Functions | ', '', ' | Lines | ', '', ' |
---|---|---|---|---|---|---|---|---|---|
{{file}} | ', '{{#show_picture}}{{metrics.statements.pct}}{{/show_picture}} | ',
'{{metrics.statements.pct}}% | ', '{{metrics.statements.covered}}/{{metrics.statements.total}} | ', '{{metrics.branches.pct}}% | ', '{{metrics.branches.covered}}/{{metrics.branches.total}} | ', '{{metrics.functions.pct}}% | ', '{{metrics.functions.covered}}/{{metrics.functions.total}} | ', '{{metrics.lines.pct}}% | ', '{{metrics.lines.covered}}/{{metrics.lines.total}} | ', '