Skip to content

Commit

Permalink
writer-html: reword warnings about Coverity parsing
Browse files Browse the repository at this point in the history
... to make them more self-explaining

Resolves: https://issues.redhat.com/browse/OSH-422
Closes: csutils#211
  • Loading branch information
kdudka committed Oct 7, 2024
1 parent cbc6147 commit b8aeaa2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/lib/writer-html.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void writeParseWarnings(std::ostream &str, const TScanProps &props) {
const int ratio = boost::lexical_cast<float>(itRatio->second);
if (ratio < parsingRatioThr)
str << "<p><b class='parseWarning'>warning:</b> "
"low parsing ratio: " << ratio << "%</p>\n";
"low ratio of compilation units successfully parsed by Coverity: " << ratio << "%</p>\n";

itCount = props.find("diffbase-cov-compilation-unit-count");
itRatio = props.find("diffbase-cov-compilation-unit-ratio");
Expand All @@ -158,12 +158,12 @@ void writeParseWarnings(std::ostream &str, const TScanProps &props) {
const int baseRatio = boost::lexical_cast<float>(itRatio->second);
if (baseRatio < parsingRatioThr && baseRatio < ratio)
str << "<p><b class='parseWarning'>warning:</b> "
"low parsing ratio in diff base: "
"low ratio of compilation units successfully parsed by Coverity in diff base: "
<< baseRatio << "%</p>\n";

if (!count || 100 * baseCount / count < parsingOldToNewRatioThr)
str << "<p><b class='parseWarning'>warning:</b> "
"low count of parsed units in diff base: "
"low count of compilation units successfully parsed by Coverity in diff base: "
<< baseCount << "</p>\n";
}
catch (boost::bad_lexical_cast &) {
Expand Down
2 changes: 1 addition & 1 deletion tests/cshtml/0001-smoke/old/scan-results.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"analyzer-version-cppcheck": "1.80",
"analyzer-version-gcc": "4.8.5",
"analyzer-version-shellcheck": "0.4.7",
"cov-compilation-unit-count": 149,
"cov-compilation-unit-count": 49,
"cov-compilation-unit-ratio": 100,
"cov-lines-processed": 127521,
"cov-time-elapsed-analysis": "00:01:51",
Expand Down
8 changes: 5 additions & 3 deletions tests/cshtml/0001-smoke/scan-results.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<body>
<h1>curl-7.60.0-1.el8+7</h1>
<a href='scan-results.err'>[Show plain-text results]</a>
<p><b class='parseWarning'>warning:</b> low ratio of compilation units successfully parsed by Coverity: 80%</p>
<p><b class='parseWarning'>warning:</b> low count of compilation units successfully parsed by Coverity in diff base: 49</p>
<h2>List of Findings</h2>
<pre>
<a id='def1'></a><b>Error: <span class='checker'>SHELLCHECK_WARNING</span>:</b> <a href='#def1'>[#def1]</a>
Expand Down Expand Up @@ -1430,11 +1432,11 @@ <h2>Scan Properties</h2>
<tr class='oddRow'><td class='scanPropName'>analyzer-version-cppcheck</td><td>1.80</td></tr>
<tr><td class='scanPropName'>analyzer-version-gcc</td><td>8.1.1</td></tr>
<tr class='oddRow'><td class='scanPropName'>analyzer-version-shellcheck</td><td>0.4.7</td></tr>
<tr><td class='scanPropName'>cov-compilation-unit-count</td><td>193</td></tr>
<tr class='oddRow'><td class='scanPropName'>cov-compilation-unit-ratio</td><td>100</td></tr>
<tr><td class='scanPropName'>cov-compilation-unit-count</td><td>154</td></tr>
<tr class='oddRow'><td class='scanPropName'>cov-compilation-unit-ratio</td><td>80</td></tr>
<tr><td class='scanPropName'>cov-lines-processed</td><td>174359</td></tr>
<tr class='oddRow'><td class='scanPropName'>cov-time-elapsed-analysis</td><td>00:01:55</td></tr>
<tr><td class='scanPropName'>diffbase-cov-compilation-unit-count</td><td>149</td></tr>
<tr><td class='scanPropName'>diffbase-cov-compilation-unit-count</td><td>49</td></tr>
<tr class='oddRow'><td class='scanPropName'>diffbase-cov-compilation-unit-ratio</td><td>100</td></tr>
<tr><td class='scanPropName'>exit-code</td><td>0</td></tr>
<tr class='oddRow'><td class='scanPropName'>host</td><td>cov01.lab.eng.brq.redhat.com</td></tr>
Expand Down
4 changes: 2 additions & 2 deletions tests/cshtml/0001-smoke/scan-results.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"analyzer-version-cppcheck": "1.80",
"analyzer-version-gcc": "8.1.1",
"analyzer-version-shellcheck": "0.4.7",
"cov-compilation-unit-count": 193,
"cov-compilation-unit-ratio": 100,
"cov-compilation-unit-count": 154,
"cov-compilation-unit-ratio": 80,
"cov-lines-processed": 174359,
"cov-time-elapsed-analysis": "00:01:55",
"exit-code": 0,
Expand Down

0 comments on commit b8aeaa2

Please sign in to comment.