Skip to content

Commit db92998

Browse files
authored
Merge pull request #1739 from guwirth/cppcheck-1.88
Cppcheck 1.88 support
2 parents aa4493c + 4590307 commit db92998

File tree

2 files changed

+115
-1
lines changed

2 files changed

+115
-1
lines changed

cxx-sensors/src/main/resources/cppcheck.xml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9730,5 +9730,119 @@ can only be set at construction time.
97309730
<type>CODE_SMELL</type>
97319731
<remediationFunction>LINEAR</remediationFunction>
97329732
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
9733+
</rule>
9734+
<rule>
9735+
<key>comparePointers</key>
9736+
<name>Comparing pointers that point to different objects</name>
9737+
<description><![CDATA[
9738+
<p>
9739+
Comparing pointers that point to different objects
9740+
</p>
9741+
<h2>References</h2>
9742+
<p><a href="https://cwe.mitre.org/data/definitions/570.html" target="_blank">CWE-570: Expression is Always False</a></p>
9743+
]]>
9744+
</description>
9745+
<tag>cwe</tag>
9746+
<tag>bug</tag>
9747+
<internalKey>comparePointers</internalKey>
9748+
<severity>MAJOR</severity>
9749+
<type>BUG</type>
9750+
<remediationFunction>LINEAR</remediationFunction>
9751+
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
9752+
</rule>
9753+
<rule>
9754+
<key>duplicateConditionalAssign</key>
9755+
<name>Duplicate expression for the condition and assignment</name>
9756+
<description><![CDATA[
9757+
<p>
9758+
Duplicate expression for the condition and assignment.
9759+
</p>
9760+
<h2>References</h2>
9761+
<p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9762+
]]>
9763+
</description>
9764+
<tag>cwe</tag>
9765+
<internalKey>duplicateConditionalAssign</internalKey>
9766+
<severity>MINOR</severity>
9767+
<type>CODE_SMELL</type>
9768+
<remediationFunction>LINEAR</remediationFunction>
9769+
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
9770+
</rule>
9771+
<rule>
9772+
<key>negativeContainerIndex</key>
9773+
<name>Array index -1 is out of bounds</name>
9774+
<description><![CDATA[
9775+
<p>
9776+
Array index -1 is out of bounds.
9777+
</p>
9778+
<h2>References</h2>
9779+
<p><a href="https://cwe.mitre.org/data/definitions/786.html" target="_blank">CWE-786: Access of Memory Location Before Start of Buffer</a></p>
9780+
]]>
9781+
</description>
9782+
<tag>cwe</tag>
9783+
<tag>bug</tag>
9784+
<internalKey>negativeContainerIndex</internalKey>
9785+
<severity>MAJOR</severity>
9786+
<type>BUG</type>
9787+
<remediationFunction>LINEAR</remediationFunction>
9788+
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
9789+
</rule>
9790+
<rule>
9791+
<key>objectIndex</key>
9792+
<name>The address of local variable '' is accessed at non-zero index</name>
9793+
<description><![CDATA[
9794+
<p>
9795+
The address of local variable '' is accessed at non-zero index.
9796+
</p>
9797+
<h2>References</h2>
9798+
<p><a href="https://cwe.mitre.org/data/definitions/758.html" target="_blank">CWE-758: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior</a></p>
9799+
]]>
9800+
</description>
9801+
<tag>cwe</tag>
9802+
<tag>bug</tag>
9803+
<internalKey>objectIndex</internalKey>
9804+
<severity>MAJOR</severity>
9805+
<type>BUG</type>
9806+
<remediationFunction>LINEAR</remediationFunction>
9807+
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
97339808
</rule>
9809+
<rule>
9810+
<key>stlFindInsert</key>
9811+
<name>Searching before insertion is not necessary</name>
9812+
<description><![CDATA[
9813+
<p>
9814+
Searching before insertion is not necessary.
9815+
</p>
9816+
<h2>References</h2>
9817+
<p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9818+
]]>
9819+
</description>
9820+
<tag>cwe</tag>
9821+
<tag>bug</tag>
9822+
<internalKey>stlFindInsert</internalKey>
9823+
<severity>MINOR</severity>
9824+
<type>BUG</type>
9825+
<remediationFunction>LINEAR</remediationFunction>
9826+
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
9827+
</rule>
9828+
<rule>
9829+
<key>uninitMemberVarPrivate</key>
9830+
<name>Member variable 'classname::varnamepriv' is not initialized in the constructor</name>
9831+
<description><![CDATA[
9832+
<p>
9833+
Member variable 'classname::varnamepriv' is not initialized in the
9834+
constructor.
9835+
</p>
9836+
<h2>References</h2>
9837+
<p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9838+
]]>
9839+
</description>
9840+
<tag>cwe</tag>
9841+
<tag>bug</tag>
9842+
<internalKey>uninitMemberVarPrivate</internalKey>
9843+
<severity>MINOR</severity>
9844+
<type>BUG</type>
9845+
<remediationFunction>LINEAR</remediationFunction>
9846+
<remediationFunctionGapMultiplier>5min</remediationFunctionGapMultiplier>
9847+
</rule>
97349848
</rules>

cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void createRulesTest() {
4141
def.define(context);
4242

4343
RulesDefinition.Repository repo = context.repository(CxxCppCheckRuleRepository.getRepositoryKey(language));
44-
assertEquals(510, repo.rules().size());
44+
assertEquals(516, repo.rules().size());
4545
}
4646

4747
}

0 commit comments

Comments
 (0)