Skip to content

Commit a4ea1ec

Browse files
committed
json-parser: rename SnykTreeDecoder -> SarifTreeDecoder
No changes in behavior intended by this commit.
1 parent 1e68df9 commit a4ea1ec

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/json-parser.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class CovTreeDecoder: public AbstractTreeDecoder {
6464
KeyEventDigger keDigger;
6565
};
6666

67-
/// tree decoder of the JSON format produced by Snyk Code
68-
class SnykTreeDecoder: public AbstractTreeDecoder {
67+
/// tree decoder of the SARIF format
68+
class SarifTreeDecoder: public AbstractTreeDecoder {
6969
public:
7070
virtual void readScanProps(
7171
TScanProps *pDst,
@@ -128,8 +128,8 @@ JsonParser::JsonParser(InStream &input):
128128
// Coverity JSON format
129129
d->decoder = new CovTreeDecoder;
130130
else if (findChildOf(&node, d->root, "runs"))
131-
// JSON format produced by Snyk Code
132-
d->decoder = new SnykTreeDecoder;
131+
// SARIF format
132+
d->decoder = new SarifTreeDecoder;
133133
else
134134
throw pt::ptree_error("unknown JSON format");
135135

@@ -370,7 +370,7 @@ bool CovTreeDecoder::readNode(
370370
return true;
371371
}
372372

373-
void SnykTreeDecoder::readScanProps(
373+
void SarifTreeDecoder::readScanProps(
374374
TScanProps *pDst,
375375
const pt::ptree *root)
376376
{
@@ -401,7 +401,7 @@ void SnykTreeDecoder::readScanProps(
401401
(*pDst)["analyzer-version-snyk-code"] = version;
402402
}
403403

404-
void SnykTreeDecoder::readRoot(
404+
void SarifTreeDecoder::readRoot(
405405
const pt::ptree **pDefList,
406406
const pt::ptree *runs)
407407
{
@@ -411,7 +411,7 @@ void SnykTreeDecoder::readRoot(
411411
pDefList = nullptr;
412412
}
413413

414-
void snykReadLocation(DefEvent *pEvt, const pt::ptree &defNode)
414+
void sarifReadLocation(DefEvent *pEvt, const pt::ptree &defNode)
415415
{
416416
const pt::ptree *locs;
417417
if (!findChildOf(&locs, defNode, "locations") || locs->empty())
@@ -439,14 +439,14 @@ void snykReadLocation(DefEvent *pEvt, const pt::ptree &defNode)
439439
}
440440
}
441441

442-
bool SnykTreeDecoder::readNode(
442+
bool SarifTreeDecoder::readNode(
443443
Defect *def,
444444
pt::ptree::const_iterator defIter)
445445
{
446446
// initialize the defect structure
447447
*def = Defect("SNYK_CODE_WARNING");
448448

449-
// the current node representing a single snyk's report
449+
// the current node representing a single SARIF report
450450
const pt::ptree &defNode = defIter->second;
451451

452452
// initialize the key event
@@ -461,7 +461,7 @@ bool SnykTreeDecoder::readNode(
461461

462462
// read location
463463
keyEvent.fileName = "<unknown>";
464-
snykReadLocation(&keyEvent, defNode);
464+
sarifReadLocation(&keyEvent, defNode);
465465

466466
// read diagnostic message
467467
const pt::ptree *msgNode;

0 commit comments

Comments
 (0)