Skip to content

Commit

Permalink
fix sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jun 30, 2024
1 parent 2a1a6ec commit affb3ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
20 changes: 11 additions & 9 deletions lib/converter/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1239,15 +1239,17 @@ const initJsCoverageList = (item) => {
inUncoveredRange.coveredList.push(range);
}
}
} else {
if (count === 0) {
uncoveredBlocks.push({
... range,
index: i,
ranges: block.ranges
});
}
return;
}

if (count === 0) {
uncoveredBlocks.push({
... range,
index: i,
ranges: block.ranges
});
}

});
});

Expand Down Expand Up @@ -1283,7 +1285,7 @@ const initJsCoverageList = (item) => {
});
}

ranges.splice.apply(ranges, args);
ranges.splice(... args);

});
}
Expand Down
11 changes: 6 additions & 5 deletions lib/platform/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,13 @@ const Util = {
// 2, uncovered entire and pieces
if (count > 0) {
lineItem.coveredCount = Math.max(lineItem.coveredCount, count);
return;
}

if (it.entire) {
lineItem.uncoveredEntire = it;
} else {
if (it.entire) {
lineItem.uncoveredEntire = it;
} else {
lineItem.uncoveredPieces.push(it);
}
lineItem.uncoveredPieces.push(it);
}

});
Expand Down

0 comments on commit affb3ba

Please sign in to comment.