codacy-coverage
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,2 +0,2 @@ | ||
(function (lcovParse, Promise, Joi, logger, path) { | ||
(function (lcovParse, Promise, Joi, logger, util, path) { | ||
'use strict'; | ||
@@ -13,4 +13,4 @@ | ||
var validOptions = Joi.validate(options, optionsValidation, { | ||
stripUnknown: true | ||
}); | ||
stripUnknown: true | ||
}); | ||
var validationError = validLcov.error || validOptions.error; | ||
@@ -32,5 +32,5 @@ | ||
var result = { | ||
total: 0, | ||
fileReports: [] | ||
}; | ||
total: 0, | ||
fileReports: [] | ||
}; | ||
var totalLines = 0; | ||
@@ -51,3 +51,3 @@ var totalHits = 0; | ||
// The API uses integers only, so convert accordingly. | ||
fileStats.total = Math.floor((stats.lines.hit / stats.lines.found) * 100); | ||
fileStats.total = Math.floor(util.safeDivision(stats.lines.hit, stats.lines.found) * 100); | ||
@@ -68,3 +68,3 @@ //TODO: Convert to reduce function | ||
// The API uses integers only, so convert accordingly. | ||
result.total = Math.floor((totalHits / totalLines) * 100); | ||
result.total = Math.floor(util.safeDivision(totalHits, totalLines) * 100); | ||
@@ -78,2 +78,2 @@ logger.debug('Successfully Parsed Lcov Data'); | ||
}; | ||
}(require('lcov-parse'), require('bluebird'), require('joi'), require('../logger')(), require('path'))); | ||
}(require('lcov-parse'), require('bluebird'), require('joi'), require('../logger')(), require('../util'), require('path'))); |
{ | ||
"name": "codacy-coverage", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Code Coverage reporter for Codacy.com", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -96,3 +96,3 @@ (function (fs, parser, helper, path) { | ||
expect(JSON.stringify(data)).to.equal(JSON.stringify({ | ||
total: null, | ||
total: 0, | ||
fileReports: [ | ||
@@ -102,3 +102,3 @@ { | ||
coverage: {}, | ||
total: null | ||
total: 0 | ||
} | ||
@@ -114,3 +114,3 @@ ] | ||
expect(JSON.stringify(data)).to.equal(JSON.stringify({ | ||
total: null, | ||
total: 0, | ||
fileReports: [ | ||
@@ -120,3 +120,3 @@ { | ||
coverage: {}, | ||
total: null | ||
total: 0 | ||
} | ||
@@ -123,0 +123,0 @@ ] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51677
30
870