mythx-report-helper
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -7,6 +7,15 @@ "use strict"; | ||
return issuesClone.map((issues) => { | ||
let InstructionCoverageOverTime = issues.meta.InstructionCoverageOverTime; | ||
let PercentageCoverageOverTime = issues.meta.PercentageCoverageOverTime && | ||
JSON.parse(issues.meta.PercentageCoverageOverTime); | ||
let LineCoverage = issues.meta.LineCoverage && JSON.parse(issues.meta.LineCoverage); | ||
let InstructionCoverageOverTime = issues.meta.InstructionCoverageOverTime || []; | ||
let PercentageCoverageOverTime = issues.meta.PercentageCoverageOverTime | ||
? JSON.parse(issues.meta.PercentageCoverageOverTime) | ||
: []; | ||
let BranchCoverageOverTime = issues.meta.BranchCoverageOverTime | ||
? JSON.parse(issues.meta.BranchCoverageOverTime) | ||
: []; | ||
let PathCoverageOverTime = issues.meta.PathCoverageOverTime | ||
? JSON.parse(issues.meta.PathCoverageOverTime) | ||
: []; | ||
let LineCoverage = issues.meta.LineCoverage | ||
? JSON.parse(issues.meta.LineCoverage) | ||
: []; | ||
if (InstructionCoverageOverTime && | ||
@@ -16,10 +25,33 @@ typeof InstructionCoverageOverTime === 'string') { | ||
} | ||
if (InstructionCoverageOverTime) { | ||
const [instructionSeries, instructionsUnit] = normalizeTimeSeries(InstructionCoverageOverTime); | ||
issues.meta = Object.assign({}, issues.meta, { InstructionCoverageOverTime: instructionSeries, InstructionCoverageOverTimeUnit: instructionsUnit }); | ||
; | ||
[ | ||
InstructionCoverageOverTime, | ||
PercentageCoverageOverTime, | ||
BranchCoverageOverTime, | ||
PathCoverageOverTime, | ||
] = [ | ||
InstructionCoverageOverTime, | ||
PercentageCoverageOverTime, | ||
BranchCoverageOverTime, | ||
PathCoverageOverTime, | ||
].map((originalSeries) => { | ||
if (originalSeries.length && originalSeries.length > 0) { | ||
const [series, unit] = normalizeTimeSeries(originalSeries); | ||
return [series, unit]; | ||
} | ||
else | ||
return []; | ||
}); | ||
if (InstructionCoverageOverTime.length === 2) { | ||
issues.meta = Object.assign({}, issues.meta, { InstructionCoverageOverTime: InstructionCoverageOverTime[0], InstructionCoverageOverTimeUnit: InstructionCoverageOverTime[1] }); | ||
} | ||
if (PercentageCoverageOverTime) { | ||
const [percentageSeries, percentageUnit] = normalizeTimeSeries(PercentageCoverageOverTime); | ||
issues.meta = Object.assign({}, issues.meta, { PercentageCoverageOverTime: percentageSeries, PercentageCoverageOverTimeUnit: percentageUnit }); | ||
if (PercentageCoverageOverTime.length === 2) { | ||
issues.meta = Object.assign({}, issues.meta, { PercentageCoverageOverTime: PercentageCoverageOverTime[0], PercentageCoverageOverTimeUnit: PercentageCoverageOverTime[1] }); | ||
} | ||
if (BranchCoverageOverTime.length === 2) { | ||
issues.meta = Object.assign({}, issues.meta, { BranchCoverageOverTime: BranchCoverageOverTime[0], BranchCoverageOverTimeUnit: BranchCoverageOverTime[1] }); | ||
} | ||
if (PathCoverageOverTime.length === 2) { | ||
issues.meta = Object.assign({}, issues.meta, { PathCoverageOverTime: PathCoverageOverTime[0], PathCoverageOverTimeUnit: PathCoverageOverTime[1] }); | ||
} | ||
if (LineCoverage) { | ||
@@ -26,0 +58,0 @@ let lineCoverage = {}; |
{ | ||
"name": "mythx-report-helper", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "TS helper to manage mythx reports", | ||
@@ -5,0 +5,0 @@ "main": "./build/src/index.js", |
Sorry, the diff of this file is not supported yet
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
50751
492