razat-ag/embold_hf_java huggingface dataset:
UselessOperationOnImmutable 
 An operation on an Immutable object (String, BigDecimal or BigInteger) won't change the object itself
UnusedNullCheckInEquals 
 Invoke equals() on the object you''ve already ensured is not null
UnusedPrivateField 
 Avoid unused private fields such as ''{0}''.
UnusedPrivateMethod 
 Avoid unused private methods such as ''{0}''.
UnusedFormalParameter 
 Avoid unused {0} parameters such as ''{1}''.
UnsynchronizedStaticFormatter 
 Instances of java.text.Format are generally not synchronized. Sun recommends using separate format instances for each thread. If multiple threads must access a static formatter, the formatter must be synchronized on block level.
InvalidLogMessageFormat 
 Check for messages in slf4j and log4j2 (since 6.19.0) loggers with non matching number of arguments and placeholders.
AvoidUncheckedExceptionsInSignatures 
 A method or constructor should not explicitly declare unchecked exceptions in its throws clause. Java doesn’t force the caller to handle an unchecked exception, so it’s unnecessary except for documentation. A better practice is to document the exceptional cases with a @throws Javadoc tag, which allows being more descriptive.
DataClass 
 Data Classes are simple data holders, which reveal most of their state, and without complex functionality
NcssCount 
 This rule uses the NCSS (Non-Commenting Source Statements) metric to determine the number of lines of code in a class, method or constructor
ControlStatementBraces 
 Enforce a policy for braces on control statements. It is recommended to use braces on ‘if … else’ statements and loop statements, even if they are optional.
FormalParameterNamingConventions 
 Configurable naming conventions for formal parameters of methods and lambdas
IdenticalCatchBranches 
 Identical catch branches use up vertical space and increase the complexity of code without adding functionality. It’s better style to collapse identical branches into a single multi-catch branch.
LinguisticNaming 
 This rule finds Linguistic Naming Antipatterns. It checks for fields, that are named, as if they should be boolean but have a different type. It also checks for methods, that according to their name, should return a boolean, but don’t.
LocalVariableNamingConventions 
 Configurable naming conventions for local variable declarations and other locally-scoped variables.
UnnecessaryAnnotationValueElement 
 Avoid the use of value in annotations when it’s the only element.
UnnecessaryCast 
 This rule detects when a cast is unnecessary while accessing collection elements. This rule is mostly useful for old java code before generics where introduced with java 1.5.
UseDiamondOperator 
 Use the diamond operator to let the type be inferred automatically.
DetachedTestCase 
 The method appears to be a test case since it has public or default visibility, non-static access, no arguments, no return value, has no annotations, but is a member of a class that has one or more JUnit test cases. If it is a utility method, it should likely have private visibility. If it is an ignored test, it should be annotated with @Test and @Ignore.
DoNotExtendJavaLangThrowable 
 Extend Exception or RuntimeException instead of Throwable.
AccessorMethodGeneration 
 When accessing a private field / method from another class, the Java compiler will generate a accessor methods with package-private visibility.
AvoidMessageDigestField 
 Declaring a MessageDigest instance as a field make this instance directly available to multiple threads. Such sharing of MessageDigest instances should be avoided if possible since it leads to wrong results if the access is not synchronized correctly. Just create a new instance and use it locally, where you need it. Creating a new instance is easier than synchronizing access to a shared instance.
AvoidReassigningLoopVariables 
 Reassigning loop variables can lead to hard-to-find bugs. Prevent or limit how these variables can be changed.
DoubleBraceInitialization 
 Double brace initialisation is a pattern to initialise eg collections concisely.
ForLoopCanBeForeach 
 Reports loops that can be safely replaced with the foreach syntax.
ForLoopVariableCount 
 Having a lot of control variables in a ‘for’ loop makes it harder to see what range of values the loop iterates over. By default this rule allows a regular ‘for’ loop with only one variable.
LiteralsFirstInComparisons 
 Position literals first in all String comparisons, if the second argument is null then NullPointerExceptions can be avoided, they will just return false. Note that switching literal positions for compareTo and compareToIgnoreCase may change the result, see examples.
MissingOverride 
 Annotating overridden methods with @Override ensures at compile time that the method really overrides one, which helps refactoring and clarifies intent.
UseTryWithResources 
 Java 7 introduced the try-with-resources statement. This statement ensures that each resource is closed at the end of the statement.
WhileLoopWithLiteralBoolean 
 do {} while (true); requires reading the end of the statement before it is apparent that it loops forever, whereas while (true) {} is easier to understand.do {} while (false); is redundant, and if an inner variable scope is required, a block {} is sufficient.while (false) {} will never execute the block and can be removed in its entirety.
UseUnderscoresInNumericLiterals 
 Since Java 1.7, numeric literals can use underscores to separate digits.
AvoidCalendarDateCreation 
 A Calendar is a heavyweight object and expensive to create.
AvoidFileStream 
 The FileInputStream and FileOutputStream classes contains a finalizer method which will cause garbage collection pauses.
UseIOStreamsWithApacheCommonsFileItem 
 Use of FileItem.get() and FileItem.getString() could exhaust memory since they load the entire file into memory.
HardCodedCryptoKey 
 Do not use hard coded values for cryptographic operations. Please store keys outside of source code.
InsecureCryptoIv 
 Do not use hard coded initialization vector in cryptographic operations. Please use a randomly generated IV.
UseShortArrayInitializer 
 When declaring and initializing array fields or variables, it is not necessary to explicitly create a new array using new.
UnnecessaryModifier 
 Fields in interfaces and annotations are automatically public static final, and methods are public abstract.
AvoidReassigningCatchVariables 
 Avoid Reassigning Catch Variables
UnusedAssignment 
 Reports assignments to variables that are never used before the variable is overwritten, or goes out of scope
JUnit5TestShouldBePackagePrivate 
 JUnit5 Test Should Be Package Private
ReturnEmptyCollectionRatherThanNull 
 Return Empty Collection Rather Than Null