From 4590307fa53ee6046003a8d38bbb5d51510c9eb3 Mon Sep 17 00:00:00 2001 From: guwirth Date: Thu, 11 Jul 2019 19:05:52 +0200 Subject: [PATCH] Cppcheck 1.88 support --- cxx-sensors/src/main/resources/cppcheck.xml | 114 ++++++++++++++++++ .../CxxCppCheckRuleRepositoryTest.java | 2 +- 2 files changed, 115 insertions(+), 1 deletion(-) diff --git a/cxx-sensors/src/main/resources/cppcheck.xml b/cxx-sensors/src/main/resources/cppcheck.xml index d3db7fe7bf..f2d10f6b08 100644 --- a/cxx-sensors/src/main/resources/cppcheck.xml +++ b/cxx-sensors/src/main/resources/cppcheck.xml @@ -9730,5 +9730,119 @@ can only be set at construction time. CODE_SMELL LINEAR 5min + + + comparePointers + Comparing pointers that point to different objects + +Comparing pointers that point to different objects +

+

References

+

CWE-570: Expression is Always False

+ ]]> +
+ cwe + bug + comparePointers + MAJOR + BUG + LINEAR + 5min +
+ + duplicateConditionalAssign + Duplicate expression for the condition and assignment + +Duplicate expression for the condition and assignment. +

+

References

+

CWE-398: 7PK - Code Quality

+ ]]> +
+ cwe + duplicateConditionalAssign + MINOR + CODE_SMELL + LINEAR + 5min +
+ + negativeContainerIndex + Array index -1 is out of bounds + +Array index -1 is out of bounds. +

+

References

+

CWE-786: Access of Memory Location Before Start of Buffer

+ ]]> +
+ cwe + bug + negativeContainerIndex + MAJOR + BUG + LINEAR + 5min +
+ + objectIndex + The address of local variable '' is accessed at non-zero index + +The address of local variable '' is accessed at non-zero index. +

+

References

+

CWE-758: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior

+ ]]> +
+ cwe + bug + objectIndex + MAJOR + BUG + LINEAR + 5min
+ + stlFindInsert + Searching before insertion is not necessary + +Searching before insertion is not necessary. +

+

References

+

CWE-398: 7PK - Code Quality

+ ]]> +
+ cwe + bug + stlFindInsert + MINOR + BUG + LINEAR + 5min +
+ + uninitMemberVarPrivate + Member variable 'classname::varnamepriv' is not initialized in the constructor + +Member variable 'classname::varnamepriv' is not initialized in the +constructor. +

+

References

+

CWE-398: 7PK - Code Quality

+ ]]> +
+ cwe + bug + uninitMemberVarPrivate + MINOR + BUG + LINEAR + 5min +
diff --git a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java index ac1c4953f7..53b95360c2 100644 --- a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java +++ b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java @@ -41,7 +41,7 @@ public void createRulesTest() { def.define(context); RulesDefinition.Repository repo = context.repository(CxxCppCheckRuleRepository.getRepositoryKey(language)); - assertEquals(510, repo.rules().size()); + assertEquals(516, repo.rules().size()); } }