Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/lib/parser-json-cov.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ bool CovTreeDecoder::readNode(Defect *def)
// out of the supported tools, only Coverity produces this data format
def->tool = "coverity";

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

// treat defects with high impact as important
if ("High" == valueOf<std::string>(*checkerProps, "impact"))
def->imp = 1;
}

// count the events and allocate dst array
const pt::ptree &evtList = defNode.get_child("events");
def->events.resize(evtList.size());
Expand Down
Loading