Skip to content

Commit 7fd72a7

Browse files
committed
parser-json-cov: treat defects with high impact as important
Resolves: https://issues.redhat.com/browse/OSH-289 Closes: #142
1 parent 5274e3d commit 7fd72a7

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

src/lib/parser-json-cov.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,17 @@ bool CovTreeDecoder::readNode(Defect *def)
5050
// out of the supported tools, only Coverity produces this data format
5151
def->tool = "coverity";
5252

53-
// read CWE if available
53+
// extract checker properties if available
5454
const pt::ptree *checkerProps;
55-
if (findChildOf(&checkerProps, defNode, "checkerProperties"))
55+
if (findChildOf(&checkerProps, defNode, "checkerProperties")) {
56+
// read CWE if available
5657
def->cwe = valueOf<int>(*checkerProps, "cweCategory");
5758

59+
// treat defects with high impact as important
60+
if ("High" == valueOf<std::string>(*checkerProps, "impact"))
61+
def->imp = 1;
62+
}
63+
5864
// count the events and allocate dst array
5965
const pt::ptree &evtList = defNode.get_child("events");
6066
def->events.resize(evtList.size());

0 commit comments

Comments
 (0)