in src/stats.ts [113:133]
read() {
if (!this.processed) {
let content = fs.readFileSync(this.fileName, 'utf-8')
let fileStats: FileStats;
content.split(/\r?\n/).forEach(line => {
if (line.startsWith(LCOV.SOURCE_FILE)) {
fileStats = new FileStats(line)
}
if (!fileStats.evaluate(line)) {
this.fileStats.push(fileStats);
this.linesFound += fileStats.linesFound;
this.linesHit += fileStats.linesHit;
this.functionsFound += fileStats.functionsFound;
this.functionsHit += fileStats.functionsHit
}
});
this.processed = true
} else {
process.stdout.write(`Attempted to read file ${this.fileName} again`)
}
}