ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
RuleDetailCWE categoryCWE weakness
2
common-java:DuplicatedBlocks
Source files should not have any duplicated blocks
Bad Coding Practices - (1006)
1071
3
common-java:SkippedUnitTests
Skipped unit tests should be either removed or fixed
Bad Coding Practices - (1006)
4
common-java:InsufficientBranchCoverage
Branches should have sufficient coverage by tests
Bad Coding Practices - (1006)
5
common-java:InsufficientCommentDensity
Source files should have a sufficient density of comment lines
Bad Coding Practices - (1006)
6
common-java:InsufficientLineCoverage
Lines should have sufficient coverage by tests
Bad Coding Practices - (1006)
7
java:S1258
Classes and enums with private members should have a constructor
Permission Issues - (275)
8
java:S2589
Boolean expressions should not be gratuitous
Expression Issues - (569)
571
9
java:S5612
Lambdas should not have too many lines
Bad Coding Practices - (1006)
10
java:S5853
Consecutive AssertJ "assertThat" statements should be chained
Bad Coding Practices - (1006)
11
java:S5854
Regexes containing characters subject to normalization should use the CANON_EQ flag
Bad Coding Practices - (1006)
12
java:S1135
Track uses of "TODO" tags
Bad Coding Practices - (1006)
546
13
java:S4524
"default" clauses should be last
Bad Coding Practices - (1006)
14
java:S5976
Similar tests should be grouped in a single Parameterized test
Bad Coding Practices - (1006)
15
java:S5977
Tests should use fixed data instead of randomized data
Bad Coding Practices - (1006)
16
java:S1132
Strings literals should be placed on the left side when checking for equality
String Errors - (133)
17
java:S1133
Deprecated code should be removed
Bad Coding Practices - (1006)
18
java:S1134
Track uses of "FIXME" tags
Bad Coding Practices - (1006)
546
19
java:S2221
"Exception" should not be caught when not required by called methods
Error Conditions, Return Values, Status Codes - (389)
396
20
java:S5970
Spring's ModelAndViewAssert assertions should be used instead of other assertions
Bad Coding Practices - (1006)
21
java:S3553
"Optional" should not be used for parameters
Data Processing Errors - (19)
22
java:S5973
Tests should be stable
Bad Coding Practices - (1006)
23
java:S1130
"throws" declarations should not be superfluous
Error Conditions, Return Values, Status Codes - (389)
24
java:S3437
Value-based objects should not be serialized
Bad Coding Practices - (1006)
25
java:S5857
Character classes should be preferred over reluctant quantifiers in regular expressions
Expression Issues - (569)
26
java:S3688
Track uses of disallowed classes
Bad Coding Practices - (1006)
27
java:S5738
"@Deprecated" code marked for removal should never be used
API / Function Errors - (1228)
477
28
java:S864
Limited dependence should be placed on operator precedence
Behavioral Problems - (438)
783
29
java:S1147
Exit methods should not be called
Bad Coding Practices - (1006)
382
30
java:S2479
Whitespace and control characters in literals should be explicit
Data Processing Errors - (19)
31
java:S5867
Unicode-aware versions of character classes should be preferred
Data Processing Errors - (19)
32
java:S2234
Parameters should be passed in the correct order
Data Processing Errors - (19)
33
java:S2235
IllegalMonitorStateException should not be caught
Bad Coding Practices - (1006)
34
java:S1144
Unused "private" methods should be removed
Permission Issues - (275)
35
java:S2232
"ResultSet.isLast()" should not be used
API / Function Errors - (1228)
36
java:S1264
A "while" loop should be used instead of a "for" loop
Behavioral Problems - (438)
37
java:S2112
"URL.hashCode" and "URL.equals" should be avoided
Bad Coding Practices - (1006)
38
java:S5860
Names of regular expressions named groups should be used
Expression Issues - (569)
39
java:S1141
Try-catch blocks should not be nested
Error Conditions, Return Values, Status Codes - (389)
40
java:S1142
Methods should not have too many return statements
Bad Coding Practices - (1006)
41
java:S881
Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
Bad Coding Practices - (1006)
42
java:S1149
Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used
Bad Coding Practices - (1006)
43
java:S5869
Character classes in regular expressions should not contain the same character twice
Expression Issues - (569)
44
java:S1598
Package declaration should match source file directory
Bad Coding Practices - (1006)
45
java:S2203
"collect" should be used with "Streams" instead of "list::add"
File Handling Issues - (1219)
46
java:S2325
"private" and "final" methods that don't access instance data should be "static"
Permission Issues - (275)
47
java:S3776
Cognitive Complexity of methods should not be too high
Complexity Issues - (1226)
48
java:S1113
The Object.finalize() method should not be overridden
Bad Coding Practices - (1006)
49
java:S3414
Tests should be kept in a dedicated source directory
Bad Coding Practices - (1006)
50
java:S1596
"Collections.EMPTY_LIST", "EMPTY_MAP", and "EMPTY_SET" should not be used
Bad Coding Practices - (1006)
51
java:S2444
Lazy initialization of "static" fields should be "synchronized"
Initialization and Cleanup Errors - (452)
52
java:NoSonar
Track uses of "NOSONAR" comments
Bad Coding Practices - (1006)
53
java:S1110
Redundant pairs of parentheses should be removed
Bad Coding Practices - (1006)
54
java:S1119
Labels should not be used
Bad Coding Practices - (1006)
55
java:S2209
"static" members should be accessed statically
Permission Issues - (275)
56
java:S2440
Classes with only "static" methods should not be instantiated
Permission Issues - (275)
57
java:S2442
"Lock" objects should not be "synchronized"
Resource Locking Problems - (411)
58
java:S2681
Multiline blocks should be enclosed in curly braces
Behavioral Problems - (438)
483
59
java:S1117
Local variables should not shadow class fields
Bad Coding Practices - (1006)
60
java:S1118
Utility classes should not have public constructors
Permission Issues - (275)
61
java:S2208
Wildcard imports should not be used
API / Function Errors - (1228)
62
java:S2326
Unused type parameters should be removed
Bad Coding Practices - (1006)
63
java:S3415
Assertion arguments should be passed in the correct order
Bad Coding Practices - (1006)
64
java:S5838
Chained AssertJ assertions should be simplified to the corresponding dedicated assertion
Bad Coding Practices - (1006)
65
java:S1116
Empty statements should be removed
Bad Coding Practices - (1006)
66
java:S1479
"switch" statements should not have too many "case" clauses
Bad Coding Practices - (1006)
67
java:S2447
Null should not be returned from a "Boolean" method
Pointer Issues - (465)
476
68
java:S3416
Loggers should be named for their enclosing classes
Audit / Logging Errors - (1210)
69
java:S3658
Unit tests should throw exceptions
Error Conditions, Return Values, Status Codes - (389)
70
java:S5958
AssertJ "assertThatThrownBy" should not be used alone
Error Conditions, Return Values, Status Codes - (389)
71
java:S1126
Return of boolean expressions should not be wrapped into an "if-then-else" statement
Expression Issues - (569)
72
java:S2698
Test assertions should include messages
Bad Coding Practices - (1006)
73
java:S5843
Regular expressions should not be too complicated
Expression Issues - (569)
74
java:S1125
Boolean literals should not be redundant
Bad Coding Practices - (1006)
75
java:S1488
Local variables should not be declared and then immediately returned or thrown
Bad Coding Practices - (1006)
76
java:S2699
Tests should include assertions
Bad Coding Practices - (1006)
77
java:S4635
String offset-based methods should be preferred for finding substrings from offsets
Bad Coding Practices - (1006)
78
java:S1121
Assignments should not be made from within sub-expressions
Expression Issues - (569)
481
79
java:S1123
Deprecated elements should have both the annotation and the Javadoc tag
Documentation Issues - (1225)
80
java:S1124
Modifiers should be declared in the correct order
Bad Coding Practices - (1006)
81
java:S2211
Types should be used in lambdas
Type Errors - (136)
82
java:S2333
Redundant modifiers should not be used
Bad Coding Practices - (1006)
83
java:S2694
Inner classes which do not reference their owning classes should be "static"
Permission Issues - (275)
84
java:S2696
Instance methods should not write to "static" fields
Permission Issues - (275)
85
java:S1120
Source code should be indented consistently
Bad Coding Practices - (1006)
86
java:S1128
Unnecessary imports should be removed
Bad Coding Practices - (1006)
87
java:S2692
"indexOf" checks should not be for positive numbers
Pointer Issues - (465)
88
java:S2693
Threads should not be started in constructors
Concurrency Issues - (557)
89
java:S5846
Empty lines should not be tested with regex MULTILINE flag
Bad Coding Practices - (1006)
90
java:S5961
Test methods should not contain too many assertions
Bad Coding Practices - (1006)
91
java:S3305
Factory method injection should be used in "@Configuration" classes
Data Neutralization Issues - (137)
92
java:S1481
Unused local variables should be removed
Bad Coding Practices - (1006)
93
java:S2148
Underscores should be used to make large numbers readable
Bad Coding Practices - (1006)
94
java:S3358
Ternary operators should not be nested
Expression Issues - (569)
95
java:S5413
'List.remove()' should not be used in ascending 'for' loops
Behavioral Problems - (438)
96
java:S5776
Exception testing via JUnit ExpectedException rule should not be mixed with other assertions
Error Conditions, Return Values, Status Codes - (389)
97
java:S5777
Exception testing via JUnit @Test annotation should be avoided
Error Conditions, Return Values, Status Codes - (389)
98
java:S5969
Mocking all non-private methods of a class should be avoided
Permission Issues - (275)
99
java:S1176
Public types, methods and fields (API) should be documented with Javadoc
Documentation Issues - (1225)
100
java:S2147
Catches should be combined
Error Conditions, Return Values, Status Codes - (389)