Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function populateCoverage(cov) {
cov.LOC = cov.SLOC = cov.totalHits = cov.totalMisses = cov.coverage = 0;
var files = [];
for (var name in cov) {
var file = cov[name];
if (comb.isArray(file)) {
// Stats
files.push(file);
delete cov[name];
cov.totalHits += file.totalHits = coverage(file, true);
cov.totalMisses += file.totalMisses = coverage(file, false);
cov.SLOC += file.SLOC = file.totalHits + file.totalMisses;
!file.source && (file.source = []);
cov.LOC += file.LOC = file.source.length;
file.coverage = ((file.totalHits / file.SLOC) * 100).toFixed(2);
// Source
file.name = name;
if (file.coverage < 100) {
var width = file.source.length.toString().length;
file.source = file.source.map(
function (line, i) {
++i;
function exec(cmds) {
if (!comb.isArray(cmds)) {
cmds = [cmds];
}
return comb.async.array(cmds).forEach(function (cmd) {
if (cmd) {
log.debug(util.format("Executing %s %s", cmd.cmd, cmd.args.join(" ")));
var child = execP(cmd.cmd, cmd.args, { stdio: "inherit" }),
ret = new comb.Promise();
child.on("close", function (code) {
if (code !== 0) {
ret.errback(new Error("ps process exited with code " + code));
} else {
ret.callback();
}
});
child.on("error", ret.errback);
enroll: function (clas) {
if (comb.isArray(clas)) {
return this.addClasses(clas);
} else {
return this.addClass(clas);
}
}
},
enroll: function (clas) {
if (comb.isArray(clas)) {
return this.addClasses(clas);
} else {
return this.addClass(clas);
}
}
},
enroll: function (clas) {
if (comb.isArray(clas)) {
return this.addClasses(clas);
} else {
return this.addClass(clas);
}
}
},
enroll: function (clas) {
if (comb.isArray(clas)) {
return this.addClasses(clas);
} else {
return this.addClass(clas);
}
}
},