@@ -138,11 +138,11 @@ Pointer to local array variable returned.
138
138
</rule >
139
139
<rule >
140
140
<key >returnReference</key >
141
- <name >Reference to auto variable returned</name >
141
+ <name >Reference to local variable returned</name >
142
142
<description >
143
- <![CDATA[
144
- <p>
145
- Reference to auto variable returned.
143
+ <![CDATA[
144
+ <p>
145
+ Reference to local variable returned.
146
146
</p>
147
147
<h2>References</h2>
148
148
<p><a href="https://cwe.mitre.org/data/definitions/562.html" target="_blank">CWE-562: Return of Stack Variable Address</a></p>
@@ -2223,7 +2223,7 @@ Redundant assignment to itself.
2223
2223
<description >
2224
2224
<![CDATA[
2225
2225
<p>
2226
- Variable 'var' is modified insert assert statement. Assert statements
2226
+ Variable 'var' is modified inside assert statement. Assert statements
2227
2227
are removed from release builds so the code inside assert statement is
2228
2228
not executed. If the code is needed also in release builds, this is a
2229
2229
bug.
@@ -2503,12 +2503,12 @@ be removed.
2503
2503
</rule >
2504
2504
<rule >
2505
2505
<key >unsignedLessThanZero</key >
2506
- <name >Checking if unsigned variable is less than zero</name >
2506
+ <name >Checking if unsigned expression is less than zero</name >
2507
2507
<description >
2508
2508
<![CDATA[
2509
2509
<p>
2510
- The unsigned variable 'varname' will never be negative so it is either
2511
- pointless or an error to check if it is.
2510
+ The unsigned expression 'varname' will never be negative so it is
2511
+ either pointless or an error to check if it is.
2512
2512
</p>
2513
2513
<h2>References</h2>
2514
2514
<p><a href="https://cwe.mitre.org/data/definitions/570.html" target="_blank">CWE-570: Expression is Always False</a></p>
@@ -2523,12 +2523,12 @@ pointless or an error to check if it is.
2523
2523
</rule >
2524
2524
<rule >
2525
2525
<key >unsignedPositive</key >
2526
- <name >An unsigned variable can't be negative so it is unnecessary to test it</name >
2526
+ <name >An unsigned expression can't be negative so it is unnecessary to test it</name >
2527
2527
<description >
2528
2528
<![CDATA[
2529
2529
<p>
2530
- Unsigned variable 'varname' can't be negative so it is unnecessary to
2531
- test it.
2530
+ Unsigned expression 'varname' can't be negative so it is unnecessary
2531
+ to test it.
2532
2532
</p>
2533
2533
<h2>References</h2>
2534
2534
<p><a href="https://cwe.mitre.org/data/definitions/570.html" target="_blank">CWE-570: Expression is Always False</a></p>
@@ -2602,7 +2602,7 @@ Iterators of different containers are used together.
2602
2602
</rule >
2603
2603
<rule >
2604
2604
<key >eraseDereference</key >
2605
- <name >Dereferenced iterator an already erased iterator </name >
2605
+ <name >Invalid iterator used </name >
2606
2606
<description >
2607
2607
<![CDATA[
2608
2608
<p>
@@ -3823,7 +3823,7 @@ Redundant condition: If <code>x > 11</code> the condition <code>x > 10</code> is
3823
3823
</rule >
3824
3824
<rule >
3825
3825
<key >virtualDestructor</key >
3826
- <name >Base classes should have virtual destructors </name >
3826
+ <name >Base classes should have virtual destructor </name >
3827
3827
<description >
3828
3828
<![CDATA[
3829
3829
<p>
@@ -5197,7 +5197,7 @@ calculations, the behaviour is undefined. Arithmetic operations on
5197
5197
</rule >
5198
5198
<rule >
5199
5199
<key >commaSeparatedReturn</key >
5200
- <name >Usage of comma in return statements </name >
5200
+ <name >Usage of comma in return statement </name >
5201
5201
<description >
5202
5202
<![CDATA[
5203
5203
<p>
@@ -9370,7 +9370,6 @@ Non-local variable 'x' will use object.
9370
9370
<h2>References</h2>
9371
9371
<p><a href="https://cwe.mitre.org/data/definitions/562.html" target="_blank">CWE-562: Return of Stack Variable Address</a></p>
9372
9372
]]>
9373
- <![CDATA[ ]]>
9374
9373
</description >
9375
9374
<tag >cwe</tag >
9376
9375
<tag >bug</tag >
@@ -9393,7 +9392,6 @@ examine this code carefully to determine if it is correct.
9393
9392
<h2>References</h2>
9394
9393
<p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9395
9394
]]>
9396
- <![CDATA[ ]]>
9397
9395
</description >
9398
9396
<tag >cwe</tag >
9399
9397
<internalKey >duplicateAssignExpression</internalKey >
@@ -9414,7 +9412,6 @@ required.
9414
9412
<h2>References</h2>
9415
9413
<p><a href="https://cwe.mitre.org/data/definitions/628.html" target="_blank">CWE-628: Function Call with Incorrectly Specified Arguments</a></p>
9416
9414
]]>
9417
- <![CDATA[ ]]>
9418
9415
</description >
9419
9416
<tag >cwe</tag >
9420
9417
<tag >bug</tag >
@@ -9435,7 +9432,6 @@ Using object that is out of scope.
9435
9432
<h2>References</h2>
9436
9433
<p><a href="https://cwe.mitre.org/data/definitions/562.html" target="_blank">CWE-562: Return of Stack Variable Address</a></p>
9437
9434
]]>
9438
- <![CDATA[ ]]>
9439
9435
</description >
9440
9436
<tag >cwe</tag >
9441
9437
<tag >bug</tag >
@@ -9457,7 +9453,6 @@ Same iterator is used with different containers 'container1' and
9457
9453
<h2>References</h2>
9458
9454
<p><a href="https://cwe.mitre.org/data/definitions/664.html" target="_blank">CWE-664: Improper Control of a Resource Through its Lifetime</a></p>
9459
9455
]]>
9460
- <![CDATA[ ]]>
9461
9456
</description >
9462
9457
<tag >cwe</tag >
9463
9458
<tag >bug</tag >
@@ -9479,7 +9474,6 @@ different scopes.
9479
9474
<h2>References</h2>
9480
9475
<p><a href="https://cwe.mitre.org/data/definitions/664.html" target="_blank">CWE-664: Improper Control of a Resource Through its Lifetime</a></p>
9481
9476
]]>
9482
- <![CDATA[ ]]>
9483
9477
</description >
9484
9478
<tag >cwe</tag >
9485
9479
<tag >bug</tag >
@@ -9500,7 +9494,6 @@ Comparison of iterators from containers 'container1' and 'container2'.
9500
9494
<h2>References</h2>
9501
9495
<p><a href="https://cwe.mitre.org/data/definitions/664.html" target="_blank">CWE-664: Improper Control of a Resource Through its Lifetime</a></p>
9502
9496
]]>
9503
- <![CDATA[ ]]>
9504
9497
</description >
9505
9498
<tag >cwe</tag >
9506
9499
<tag >bug</tag >
@@ -9522,7 +9515,6 @@ in different scopes.
9522
9515
<h2>References</h2>
9523
9516
<p><a href="https://cwe.mitre.org/data/definitions/664.html" target="_blank">CWE-664: Improper Control of a Resource Through its Lifetime</a></p>
9524
9517
]]>
9525
- <![CDATA[ ]]>
9526
9518
</description >
9527
9519
<tag >cwe</tag >
9528
9520
<tag >bug</tag >
@@ -9543,7 +9535,6 @@ Returning object that will be invalid when returning.
9543
9535
<h2>References</h2>
9544
9536
<p><a href="https://cwe.mitre.org/data/definitions/562.html" target="_blank">CWE-562: Return of Stack Variable Address</a></p>
9545
9537
]]>
9546
- <![CDATA[ ]]>
9547
9538
</description >
9548
9539
<tag >cwe</tag >
9549
9540
<tag >bug</tag >
@@ -9560,7 +9551,6 @@ Returning object that will be invalid when returning.
9560
9551
<![CDATA[
9561
9552
Non-boolean value returned from function returning bool
9562
9553
]]>
9563
- <![CDATA[ ]]>
9564
9554
</description >
9565
9555
<internalKey >returnNonBoolInBooleanFunction</internalKey >
9566
9556
<severity >MINOR</severity >
@@ -9579,7 +9569,6 @@ Local variable shadows outer function
9579
9569
<h2>References</h2>
9580
9570
<p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9581
9571
]]>
9582
- <![CDATA[ ]]>
9583
9572
</description >
9584
9573
<tag >cwe</tag >
9585
9574
<internalKey >shadowFunction</internalKey >
@@ -9599,7 +9588,6 @@ Local variable shadows outer variable
9599
9588
<h2>References</h2>
9600
9589
<p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9601
9590
]]>
9602
- <![CDATA[ ]]>
9603
9591
</description >
9604
9592
<tag >cwe</tag >
9605
9593
<internalKey >shadowVar</internalKey >
@@ -9608,4 +9596,139 @@ Local variable shadows outer variable
9608
9596
<remediationFunction >LINEAR</remediationFunction >
9609
9597
<remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9610
9598
</rule >
9599
+ <rule >
9600
+ <key >constArgument</key >
9601
+ <name >Const argument</name >
9602
+ <description >
9603
+ <![CDATA[
9604
+ <p>
9605
+ Argument 'x' to function f is always 0
9606
+ </p>
9607
+ <h2>References</h2>
9608
+ <p><a href="https://cwe.mitre.org/data/definitions/570.html" target="_blank">CWE-570: Expression is Always False</a></p>
9609
+ ]]>
9610
+ </description >
9611
+ <tag >cwe</tag >
9612
+ <internalKey >constArgument</internalKey >
9613
+ <severity >MINOR</severity >
9614
+ <type >CODE_SMELL</type >
9615
+ <remediationFunction >LINEAR</remediationFunction >
9616
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9617
+ </rule >
9618
+ <rule >
9619
+ <key >danglingReference</key >
9620
+ <name >Dangling reference</name >
9621
+ <description >
9622
+ <![CDATA[
9623
+ <p>
9624
+ Non-local reference variable 'x' to local variable 'y'
9625
+ </p>
9626
+ <h2>References</h2>
9627
+ <p><a href="https://cwe.mitre.org/data/definitions/562.html" target="_blank">CWE-562: Return of Stack Variable Address</a></p>
9628
+ ]]>
9629
+ </description >
9630
+ <tag >cwe</tag >
9631
+ <tag >bug</tag >
9632
+ <internalKey >danglingReference</internalKey >
9633
+ <severity >MAJOR</severity >
9634
+ <type >BUG</type >
9635
+ <remediationFunction >LINEAR</remediationFunction >
9636
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9637
+ </rule >
9638
+ <rule >
9639
+ <key >duplicateCondition</key >
9640
+ <name >Duplicate condition</name >
9641
+ <description >
9642
+ <![CDATA[
9643
+ <p>
9644
+ The if condition is the same as the previous if condition
9645
+ </p>
9646
+ <h2>References</h2>
9647
+ <p><a href="https://cwe.mitre.org/data/definitions/398.html" target="_blank">CWE-398: 7PK - Code Quality</a></p>
9648
+ ]]>
9649
+ </description >
9650
+ <tag >cwe</tag >
9651
+ <internalKey >duplicateCondition</internalKey >
9652
+ <severity >MINOR</severity >
9653
+ <type >CODE_SMELL</type >
9654
+ <remediationFunction >LINEAR</remediationFunction >
9655
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9656
+ </rule >
9657
+ <rule >
9658
+ <key >invalidScanfFormatWidth_smaller</key >
9659
+ <name >Wrong width for scanf parameter (too small)</name >
9660
+ <description >
9661
+ <![CDATA[
9662
+ Width 'w0' given in format string is smaller than destination buffer '[w1]'.
9663
+ ]]>
9664
+ </description >
9665
+ <tag >bug</tag >
9666
+ <internalKey >invalidScanfFormatWidth_smaller</internalKey >
9667
+ <severity >MINOR</severity >
9668
+ <type >BUG</type >
9669
+ <remediationFunction >LINEAR</remediationFunction >
9670
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9671
+ </rule >
9672
+ <rule >
9673
+ <key >iterators2</key >
9674
+ <name >Same iterator is used with different containers</name >
9675
+ <description >
9676
+ <![CDATA[
9677
+ <p>
9678
+ Same iterator is used with different containers 'container0' and
9679
+ 'container1'.
9680
+ </p>
9681
+ <h2>References</h2>
9682
+ <p><a href="https://cwe.mitre.org/data/definitions/664.html" target="_blank">CWE-664: Improper Control of a Resource Through its Lifetime</a></p>
9683
+ ]]>
9684
+ </description >
9685
+ <tag >cwe</tag >
9686
+ <tag >bug</tag >
9687
+ <internalKey >iterators2</internalKey >
9688
+ <severity >MAJOR</severity >
9689
+ <type >BUG</type >
9690
+ <remediationFunction >LINEAR</remediationFunction >
9691
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9692
+ </rule >
9693
+ <rule >
9694
+ <key >nullPointerArithmeticRedundantCheck</key >
9695
+ <name >Redundant condition or NULL pointer arithmetic</name >
9696
+ <description >
9697
+ <![CDATA[
9698
+ <p>
9699
+ Either the condition is redundant or there is pointer arithmetic with
9700
+ NULL pointer.
9701
+ </p>
9702
+ <h2>References</h2>
9703
+ <p><a href="https://cwe.mitre.org/data/definitions/682.html" target="_blank">CWE-682: Incorrect Calculation</a></p>
9704
+ ]]>
9705
+ </description >
9706
+ <tag >cwe</tag >
9707
+ <tag >bug</tag >
9708
+ <internalKey >nullPointerArithmeticRedundantCheck</internalKey >
9709
+ <severity >MINOR</severity >
9710
+ <type >BUG</type >
9711
+ <remediationFunction >LINEAR</remediationFunction >
9712
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9713
+ </rule >
9714
+ <rule >
9715
+ <key >wxBitmap::SetDepthCalled</key >
9716
+ <name >This function is deprecated since version 3.1.2, dimensions and depth can only be set at construction time</name >
9717
+ <description >
9718
+ <![CDATA[
9719
+ <p>
9720
+ This function is deprecated since version 3.1.2, dimensions and depth
9721
+ can only be set at construction time.
9722
+ </p>
9723
+ <h2>References</h2>
9724
+ <p><a href="https://cwe.mitre.org/data/definitions/477.html" target="_blank">CWE-477: Use of Obsolete Function</a></p>
9725
+ ]]>
9726
+ </description >
9727
+ <tag >cwe</tag >
9728
+ <internalKey >wxBitmap::SetDepthCalled</internalKey >
9729
+ <severity >MINOR</severity >
9730
+ <type >CODE_SMELL</type >
9731
+ <remediationFunction >LINEAR</remediationFunction >
9732
+ <remediationFunctionGapMultiplier >5min</remediationFunctionGapMultiplier >
9733
+ </rule >
9611
9734
</rules >
0 commit comments