to break lines"
+ },
+ "fullDescription": {
+ "text": "Reports blank lines in Javadoc comments. Blank lines in Javadoc may signal an intention split the text to different paragraphs. However, the Javadoc tool and IntelliJ IDEA will ignore them when rendering documentation comments. The quick-fix suggests to replace the blank line with a paragraph tag (). Example: 'class Main {\n /**\n * Doesn't do anything.\n *\n * Does absolutely nothing\n */\n void foo() {}\n }' After the quick-fix is applied: 'class Main {\n /**\n * Doesn't do anything.\n *
\n * Does absolutely nothing\n */\n void foo() {}\n }' Inspection ID: JavadocBlankLines New in 2022.1",
+ "markdown": "Reports blank lines in Javadoc comments.\n\n\nBlank lines in Javadoc may signal an intention split the text to different paragraphs. However, the Javadoc tool and IntelliJ IDEA will\nignore them when rendering documentation comments.\n\n\nThe quick-fix suggests to replace the blank line with a paragraph tag (\\
).\n\n**Example:**\n\n\n class Main {\n /**\n * Doesn't do anything.\n *\n * Does absolutely nothing\n */\n void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n /**\n * Doesn't do anything.\n *
\n * Does absolutely nothing\n */\n void foo() {}\n }\n\nInspection ID: JavadocBlankLines\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocBlankLines",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UtilityClassWithPublicConstructor",
+ "shortDescription": {
+ "text": "Utility class with 'public' constructor"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }' Inspection ID: UtilityClassWithPublicConstructor",
+ "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n\nInspection ID: UtilityClassWithPublicConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UtilityClassWithPublicConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TypeParameterExtendsFinalClass",
+ "shortDescription": {
+ "text": "Type parameter extends 'final' class"
+ },
+ "fullDescription": {
+ "text": "Reports type parameters declared to extend a 'final' class. Suggests replacing the type parameter with the type of the specified 'final' class since 'final' classes cannot be extended. Example: 'void foo() {\n List extends Integer> list; // Warning: the Integer class is a final class\n }' After the quick-fix is applied: 'void foo() {\n List list;\n }' This inspection depends on the Java feature 'Generics', which is available since Java 5. Inspection ID: TypeParameterExtendsFinalClass",
+ "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List extends Integer> list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n\nThis inspection depends on the Java feature 'Generics', which is available since Java 5.\n\nInspection ID: TypeParameterExtendsFinalClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TypeParameterExtendsFinalClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TrivialIf",
+ "shortDescription": {
+ "text": "Redundant 'if' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements that can be simplified to a single assignment, 'return', or 'assert' statement. Example: 'if (foo()) {\n return true;\n } else {\n return false;\n }' After the quick-fix is applied: 'return foo();' Configure the inspection: Use the Ignore chained 'if' statements option if you want to hide a warning for chained 'if' statements. For example, in the following code the warning will be hidden, but the quick-fix will still be available: 'if (condition1) return true;\n if (condition2) return false;\n return true;' Note that replacing 'if (isTrue()) assert false;' with 'assert isTrue();' may change the program semantics when asserts are disabled if condition has side effects. Use the Ignore 'if' statements with trivial 'assert' option if you want to hide a warning for 'if' statements containing only 'assert' statement in their bodies. Inspection ID: TrivialIf",
+ "markdown": "Reports `if` statements that can be simplified to a single assignment, `return`, or `assert` statement.\n\nExample:\n\n\n if (foo()) {\n return true;\n } else {\n return false;\n }\n\nAfter the quick-fix is applied:\n\n\n return foo();\n\nConfigure the inspection:\n\nUse the **Ignore chained 'if' statements** option if you want to hide a warning for chained `if` statements.\n\nFor example, in the following code the warning will be hidden, but the quick-fix will still be available:\n\n\n if (condition1) return true;\n if (condition2) return false;\n return true;\n\nNote that replacing `if (isTrue()) assert false;` with `assert isTrue();` may change the program semantics\nwhen asserts are disabled if condition has side effects.\nUse the **Ignore 'if' statements with trivial 'assert'** option if you want to hide a warning for `if` statements\ncontaining only `assert` statement in their bodies.\n\nInspection ID: TrivialIf"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantIfStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanMethodIsAlwaysInverted",
+ "shortDescription": {
+ "text": "Boolean method is always inverted"
+ },
+ "fullDescription": {
+ "text": "Reports methods with a 'boolean' return type that are always negated when called. A quick-fix is provided to invert and optionally rename the method. For performance reasons, not all problematic methods may be highlighted in the editor. Example: 'class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }' After the quick-fix is applied: 'class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }' Inspection ID: BooleanMethodIsAlwaysInverted",
+ "markdown": "Reports methods with a `boolean` return type that are always negated when called.\n\nA quick-fix is provided to invert and optionally rename the method.\nFor performance reasons, not all problematic methods may be highlighted in the editor.\n\nExample:\n\n\n class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }\n\nInspection ID: BooleanMethodIsAlwaysInverted"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanMethodIsAlwaysInverted",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 65,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceGuardedByStatic",
+ "shortDescription": {
+ "text": "Instance member guarded by static field"
+ },
+ "fullDescription": {
+ "text": "Reports '@GuardedBy' annotations on instance fields or methods in which the guard is a 'static' field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance. Example: 'private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: InstanceGuardedByStatic",
+ "markdown": "Reports `@GuardedBy` annotations on instance fields or methods in which the guard is a `static` field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance.\n\nExample:\n\n\n private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: InstanceGuardedByStatic"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceGuardedByStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 100,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AutoCloseableResource",
+ "shortDescription": {
+ "text": "AutoCloseable used without 'try'-with-resources"
+ },
+ "fullDescription": {
+ "text": "Reports 'AutoCloseable' instances which are not used in a try-with-resources statement, also known as Automatic Resource Management. This means that the \"open resource before/in 'try', close in 'finally'\" style that had been used before try-with-resources became available, is also reported. This inspection is meant to replace all opened but not safely closed inspections when developing in Java 7 and higher. Example: 'private static void foo() throws IOException {\n InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"/someFile\");\n System.out.println(profile.read());\n }' Use the following options to configure the inspection: List subclasses of 'AutoCloseable' that do not need to be closed and should be ignored by this inspection. Note: The inspection will still report streams returned from the 'java.nio.file.Files' methods 'lines()', 'walk()', 'list()' and 'find()', even when 'java.util.stream.Stream' is listed to be ignored. These streams contain an associated I/O resource that needs to be closed. List methods returning 'AutoCloseable' that should be ignored when called. Whether to ignore an 'AutoCloseable' if it is the result of a method call. When this option is enabled, the results of factory methods will also be ignored. Whether the inspection should report if an 'AutoCloseable' instance is passed as a method call argument. If this option is enabled, the inspection assumes the resource is closed in the called method. Method calls inside a 'finally' block with 'close' in the name and an 'AutoCloseable' argument will not be ignored. Whether to ignore method references to constructors of resource classes. Whether to ignore methods that return a resource and whose name starts with 'get'. This can reduce false positives because most of the getters do not transfer the ownership of the resource, and their call sites are not responsible for closing the resource. This inspection depends on the Java feature 'Try-with-resources', which is available since Java 7. Inspection ID: AutoCloseableResource",
+ "markdown": "Reports `AutoCloseable` instances which are not used in a try-with-resources statement, also known as *Automatic Resource Management* .\n\n\nThis means that the \"open resource before/in `try`, close in `finally`\" style that had been used before\ntry-with-resources became available, is also reported.\nThis inspection is meant to replace all *opened but not safely closed* inspections when developing in Java 7 and higher.\n\n**Example:**\n\n\n private static void foo() throws IOException {\n InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"/someFile\");\n System.out.println(profile.read());\n }\n\n\nUse the following options to configure the inspection:\n\n* List subclasses of `AutoCloseable` that do not need to be closed and should be ignored by this inspection. \n **Note** : The inspection will still report streams returned from the `java.nio.file.Files` methods `lines()`, `walk()`, `list()` and `find()`, even when `java.util.stream.Stream` is listed to be ignored. These streams contain an associated I/O resource that needs to be closed.\n* List methods returning `AutoCloseable` that should be ignored when called.\n* Whether to ignore an `AutoCloseable` if it is the result of a method call. When this option is enabled, the results of factory methods will also be ignored.\n* Whether the inspection should report if an `AutoCloseable` instance is passed as a method call argument. If this option is enabled, the inspection assumes the resource is closed in the called method. Method calls inside a `finally` block with 'close' in the name and an `AutoCloseable` argument will not be ignored.\n* Whether to ignore method references to constructors of resource classes.\n* Whether to ignore methods that return a resource and whose name starts with 'get'. This can reduce false positives because most of the getters do not transfer the ownership of the resource, and their call sites are not responsible for closing the resource.\n\nThis inspection depends on the Java feature 'Try-with-resources', which is available since Java 7.\n\nInspection ID: AutoCloseableResource"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "resource",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 142,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SingleStatementInBlock",
+ "shortDescription": {
+ "text": "Code block contains single statement"
+ },
+ "fullDescription": {
+ "text": "Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body. Example: 'if (x > 0) {\n System.out.println(\"x is positive\");\n }' After the quick-fix is applied: 'if (x > 0) System.out.println(\"x is positive\");' Inspection ID: SingleStatementInBlock",
+ "markdown": "Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body.\n\nExample:\n\n\n if (x > 0) {\n System.out.println(\"x is positive\");\n }\n\nAfter the quick-fix is applied:\n\n\n if (x > 0) System.out.println(\"x is positive\");\n\nInspection ID: SingleStatementInBlock"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SingleStatementInBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TestCaseWithConstructor",
+ "shortDescription": {
+ "text": "TestCase with non-trivial constructors"
+ },
+ "fullDescription": {
+ "text": "Reports test cases with initialization logic in their constructors. If a constructor fails, the '@After' annotated or 'tearDown()' method won't be called. This can leave the test environment partially initialized, which can adversely affect other tests. Instead, initialization of test cases should be done in a 'setUp()' or '@Before' annotated method. Bad example: 'public class ImportantTest {\n private File file;\n\n public ImportantTest() throws IOException {\n file = File.createTempFile(\"xyz\", \".tmp\");\n }\n\n // ... tests go here\n }' Inspection ID: TestCaseWithConstructor",
+ "markdown": "Reports test cases with initialization logic in their constructors. If a constructor fails, the `@After` annotated or `tearDown()` method won't be called. This can leave the test environment partially initialized, which can adversely affect other tests. Instead, initialization of test cases should be done in a `setUp()` or `@Before` annotated method.\n\nBad example:\n\n\n public class ImportantTest {\n private File file;\n\n public ImportantTest() throws IOException {\n file = File.createTempFile(\"xyz\", \".tmp\");\n }\n\n // ... tests go here\n }\n\nInspection ID: TestCaseWithConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JUnitTestCaseWithNonTrivialConstructors",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 125,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadObjectAndWriteObjectPrivate",
+ "shortDescription": {
+ "text": "'readObject()' or 'writeObject()' not declared 'private'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes where the 'readObject' or 'writeObject' methods are not declared private. There is no reason these methods should ever have a higher visibility than 'private'. A quick-fix is suggested to make the corresponding method 'private'. Example: 'public class Test implements Serializable {\n public void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }' After the quick-fix is applied: 'public class Test implements Serializable {\n private void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }' Inspection ID: ReadObjectAndWriteObjectPrivate",
+ "markdown": "Reports `Serializable` classes where the `readObject` or `writeObject` methods are not declared private. There is no reason these methods should ever have a higher visibility than `private`.\n\n\nA quick-fix is suggested to make the corresponding method `private`.\n\n**Example:**\n\n\n public class Test implements Serializable {\n public void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Test implements Serializable {\n private void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }\n\nInspection ID: ReadObjectAndWriteObjectPrivate"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonPrivateSerializationMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantFileCreation",
+ "shortDescription": {
+ "text": "Redundant 'File' instance creation"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'File' creation in one of the following constructors when only 'String' path can be used: 'FileInputStream', 'FileOutputStream', 'FileReader', 'FileWriter', 'PrintStream', 'PrintWriter', 'Formatter'. Example: 'InputStream is = new FileInputStream(new File(\"in.txt\"));' After quick-fix is applied: 'InputStream is = new FileInputStream(\"in.txt\");' Inspection ID: RedundantFileCreation New in 2020.3",
+ "markdown": "Reports redundant `File` creation in one of the following constructors when only `String` path can be used: `FileInputStream`, `FileOutputStream`, `FileReader`, `FileWriter`, `PrintStream`, `PrintWriter`, `Formatter`.\n\nExample:\n\n\n InputStream is = new FileInputStream(new File(\"in.txt\"));\n\nAfter quick-fix is applied:\n\n\n InputStream is = new FileInputStream(\"in.txt\");\n\nInspection ID: RedundantFileCreation\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantFileCreation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PointlessBooleanExpression",
+ "shortDescription": {
+ "text": "Pointless boolean expression"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless. Inspection ID: PointlessBooleanExpression",
+ "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless.\n\n\nInspection ID: PointlessBooleanExpression"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PointlessBooleanExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ListenerMayUseAdapter",
+ "shortDescription": {
+ "text": "Class may extend adapter instead of implementing listener"
+ },
+ "fullDescription": {
+ "text": "Reports classes implementing listeners instead of extending corresponding adapters. A quick-fix is available to remove any redundant empty methods left after replacing a listener implementation with an adapter extension. Use the Only warn when empty implementing methods are found option to configure the inspection to warn even if no empty methods are found. Inspection ID: ListenerMayUseAdapter",
+ "markdown": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found.\n\nInspection ID: ListenerMayUseAdapter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ListenerMayUseAdapter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExpressionComparedToItself",
+ "shortDescription": {
+ "text": "Expression is compared to itself"
+ },
+ "fullDescription": {
+ "text": "Reports comparisons where left and right operand represent the identical expression. While sometimes comparing an expression with itself could be intended, in most cases, it is an oversight. Example: '// Probably left.getLength() == right.getLength() was intended\n boolean result = left.getLength() == left.getLength();' To ignore comparisons that may produce side effects, use the Ignore conditions with side effects option. Disabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations. Example: 'native int unknownMethod();\n \n ...\n \n if (unknownMethod() > unknownMethod()) {\n System.out.println(\"Got it\");\n }' Due to possible side effects of 'unknownMethod()' (on the example), the warning will only be triggered if the Ignore conditions with side effects option is disabled. Inspection ID: ExpressionComparedToItself New in 2024.2",
+ "markdown": "Reports comparisons where left and right operand represent the identical expression. While sometimes comparing an expression with itself could be intended, in most cases, it is an oversight.\n\nExample:\n\n\n // Probably left.getLength() == right.getLength() was intended\n boolean result = left.getLength() == left.getLength();\n\n\nTo ignore comparisons that may produce side effects, use the **Ignore conditions with side effects** option.\nDisabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations.\n\nExample:\n\n\n native int unknownMethod();\n \n ...\n \n if (unknownMethod() > unknownMethod()) {\n System.out.println(\"Got it\");\n }\n\nDue to possible side effects of `unknownMethod()` (on the example), the warning will only be\ntriggered if the **Ignore conditions with side effects** option is disabled.\n\nInspection ID: ExpressionComparedToItself\n\nNew in 2024.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExpressionComparedToItself",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RefusedBequest",
+ "shortDescription": {
+ "text": "Method does not call super method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that override a super method without calling it. This is also known as a refused bequest. Such methods may represent a failure of abstraction and cause hard-to-trace bugs. The inspection doesn't report methods overridden from 'java.lang.Object', except for 'clone()'. The 'clone()' method should by convention call its super method, which will return an object of the correct type. Example 1: 'class A {\n @Override\n public Object clone() {\n // does not call 'super.clone()'\n return new A();\n }\n }' Example 2: 'interface I {\n default void foo() {}\n }\n\n class A implements I {\n // warning on method when\n // 'Ignore 'default' super methods' is disabled\n @Override\n public void foo(){}\n }' Configure the inspection: Use the Only report when super method is annotated by option to ignore super methods marked with the annotations from the provided list. You can manually add annotations to the list. Use the Ignore empty super methods option to ignore super methods that are either empty or only throw an exception. Use the Ignore 'default' super methods option to ignore 'default' super methods from interfaces. Inspection ID: RefusedBequest",
+ "markdown": "Reports methods that override a super method without calling it. This is also known as a *refused bequest* . Such methods may represent a failure of abstraction and cause hard-to-trace bugs.\n\n\nThe inspection doesn't report methods overridden from `java.lang.Object`, except for `clone()`.\nThe `clone()` method should by convention call its super method,\nwhich will return an object of the correct type.\n\n**Example 1:**\n\n\n class A {\n @Override\n public Object clone() {\n // does not call 'super.clone()'\n return new A();\n }\n }\n\n**Example 2:**\n\n\n interface I {\n default void foo() {}\n }\n\n class A implements I {\n // warning on method when\n // 'Ignore 'default' super methods' is disabled\n @Override\n public void foo(){}\n }\n\nConfigure the inspection:\n\n* Use the **Only report when super method is annotated by** option to ignore super methods marked with the annotations from the provided list. You can manually add annotations to the list.\n* Use the **Ignore empty super methods** option to ignore super methods that are either empty or only throw an exception.\n* Use the **Ignore 'default' super methods** option to ignore `default` super methods from interfaces.\n\nInspection ID: RefusedBequest"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodDoesntCallSuperMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryReturn",
+ "shortDescription": {
+ "text": "Unnecessary 'return' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements at the end of constructors and methods returning 'void'. These statements are redundant and may be safely removed. This inspection does not report in JSP files. Example: 'void message() {\n System.out.println(\"Hello World\");\n return;\n }' After the quick-fix is applied: 'void message() {\n System.out.println(\"Hello World\");\n }' Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'return' statements in the then branch of 'if' statements which also have an 'else' branch. Inspection ID: UnnecessaryReturn",
+ "markdown": "Reports `return` statements at the end of constructors and methods returning `void`. These statements are redundant and may be safely removed.\n\nThis inspection does not report in JSP files.\n\nExample:\n\n\n void message() {\n System.out.println(\"Hello World\");\n return;\n }\n\nAfter the quick-fix is applied:\n\n\n void message() {\n System.out.println(\"Hello World\");\n }\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore `return` statements in the then branch of `if` statements\nwhich also have an `else` branch.\n\nInspection ID: UnnecessaryReturn"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryReturnStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicInnerClass",
+ "shortDescription": {
+ "text": "'public' nested class"
+ },
+ "fullDescription": {
+ "text": "Reports 'public' nested classes. Example: 'public class Outer {\n public static class Nested {} // warning\n public class Inner {} // warning\n public enum Mode {} // warning depends on the setting\n public interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore 'public' inner enums option to ignore 'public' inner enums. Use the Ignore 'public' inner interfaces option to ignore 'public' inner interfaces. Inspection ID: PublicInnerClass",
+ "markdown": "Reports `public` nested classes.\n\n**Example:**\n\n\n public class Outer {\n public static class Nested {} // warning\n public class Inner {} // warning\n public enum Mode {} // warning depends on the setting\n public interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore 'public' inner enums** option to ignore `public` inner enums.\n* Use the **Ignore 'public' inner interfaces** option to ignore `public` inner interfaces.\n\nInspection ID: PublicInnerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 131,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalGuard",
+ "shortDescription": {
+ "text": "Non-final '@GuardedBy' field"
+ },
+ "fullDescription": {
+ "text": "Reports '@GuardedBy' annotations in which the guarding field is not 'final'. Guarding on a non-final field may result in unexpected race conditions, as locks will be held on the value of the field (which may change), rather than the field itself. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock(); //not final guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: NonFinalGuard",
+ "markdown": "Reports `@GuardedBy` annotations in which the guarding field is not `final`.\n\nGuarding on a non-final field may result in unexpected race conditions, as locks will\nbe held on the value of the field (which may change), rather than the field itself.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock(); //not final guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: NonFinalGuard"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalGuard",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 100,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CollectionAddedToSelf",
+ "shortDescription": {
+ "text": "Collection added to itself"
+ },
+ "fullDescription": {
+ "text": "Reports cases where the argument of a method call on a 'java.util.Collection' or 'java.util.Map' is the collection or map itself. Such situations may occur as a result of copy-paste in code with raw types. Example: 'ArrayList list = new ArrayList<>();\n list.add(list); // warning here\n return list.hashCode(); // throws StackOverflowError' Inspection ID: CollectionAddedToSelf",
+ "markdown": "Reports cases where the argument of a method call on a `java.util.Collection` or `java.util.Map` is the collection or map itself. Such situations may occur as a result of copy-paste in code with raw types.\n\n**Example:**\n\n\n ArrayList list = new ArrayList<>();\n list.add(list); // warning here\n return list.hashCode(); // throws StackOverflowError\n\nInspection ID: CollectionAddedToSelf"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CollectionAddedToSelf",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarySuperQualifier",
+ "shortDescription": {
+ "text": "Unnecessary 'super' qualifier"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary 'super' qualifiers in method calls and field references. A 'super' qualifier is unnecessary when the field or method of the superclass is not hidden/overridden in the calling class. Example: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }' After the quick-fix is applied: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n foo();\n }\n }' Use the inspection settings to ignore qualifiers that help to distinguish superclass members access from the identically named members of the outer class. See also the following inspections: Java | Visibility | Access to inherited field looks like access to element from surrounding code Java | Visibility | Call to inherited method looks like call to local method Inspection ID: UnnecessarySuperQualifier",
+ "markdown": "Reports unnecessary `super` qualifiers in method calls and field references.\n\n\nA `super` qualifier is unnecessary\nwhen the field or method of the superclass is not hidden/overridden in the calling class.\n\n**Example:**\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n foo();\n }\n }\n\n\nUse the inspection settings to ignore qualifiers that help to distinguish superclass members access\nfrom the identically named members of the outer class.\n\n\nSee also the following inspections:\n\n* *Java \\| Visibility \\| Access to inherited field looks like access to element from surrounding code*\n* *Java \\| Visibility \\| Call to inherited method looks like call to local method*\n\nInspection ID: UnnecessarySuperQualifier"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessarySuperQualifier",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsOnSuspiciousObject",
+ "shortDescription": {
+ "text": "'equals()' called on classes which don't override it"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' calls on 'StringBuilder', 'StringBuffer' and instances of 'java.util.concurrent.atomic' package. The 'equals()' method is not overridden in these classes, so it may return 'false' even when the contents of the two objects are the same. If the reference equality is intended, it's better to use '==' to avoid confusion. A quick-fix for 'StringBuilder', 'StringBuffer', 'AtomicBoolean', 'AtomicInteger', 'AtomicBoolean' and 'AtomicLong' is available to transform into a comparison of contents. The quick-fix may change the semantics when one of the instances is null. Example: 'public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.equals(sb2); // Suspicious\n }' After the quick-fix is applied: 'public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.toString().equals(sb2.toString());\n }' Inspection ID: EqualsOnSuspiciousObject New in 2017.2",
+ "markdown": "Reports `equals()` calls on `StringBuilder`, `StringBuffer` and instances of `java.util.concurrent.atomic` package.\n\nThe `equals()` method is not overridden in these classes, so it may return `false` even when the contents of the\ntwo objects are the same.\nIf the reference equality is intended, it's better to use `==` to avoid confusion.\nA quick-fix for `StringBuilder`, `StringBuffer`, `AtomicBoolean`, `AtomicInteger`, `AtomicBoolean` and `AtomicLong` is available to transform into a comparison of contents. The quick-fix may change the semantics when one of the instances is null.\n\nExample:\n\n\n public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.equals(sb2); // Suspicious\n }\n\nAfter the quick-fix is applied:\n\n\n public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.toString().equals(sb2.toString());\n }\n\nInspection ID: EqualsOnSuspiciousObject\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsOnSuspiciousObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfPropertiesAsHashtable",
+ "shortDescription": {
+ "text": "Use of 'Properties' object as a 'Hashtable'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to the following methods on 'java.util.Properties' objects: 'put()' 'putIfAbsent()' 'putAll()' 'get()' For historical reasons, 'java.util.Properties' inherits from 'java.util.Hashtable', but using these methods is discouraged to prevent pollution of properties with values of types other than 'String'. Calls to 'java.util.Properties.putAll()' won't get reported when both the key and the value parameters in the map are of the 'String' type. Such a call is safe and no better alternative exists. Example: 'Object f(Properties props) {\n props.put(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.get(\"Hello\");\n }' After the quick-fix is applied: 'Object f(Properties props) {\n props.setProperty(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.getProperty(\"hello\");\n }' Inspection ID: UseOfPropertiesAsHashtable",
+ "markdown": "Reports calls to the following methods on `java.util.Properties` objects:\n\n* `put()`\n* `putIfAbsent()`\n* `putAll()`\n* `get()`\n\n\nFor historical reasons, `java.util.Properties` inherits from `java.util.Hashtable`,\nbut using these methods is discouraged to prevent pollution of properties with values of types other than `String`.\n\n\nCalls to `java.util.Properties.putAll()` won't get reported when\nboth the key and the value parameters in the map are of the `String` type.\nSuch a call is safe and no better alternative exists.\n\n**Example:**\n\n\n Object f(Properties props) {\n props.put(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.get(\"Hello\");\n }\n\nAfter the quick-fix is applied:\n\n\n Object f(Properties props) {\n props.setProperty(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.getProperty(\"hello\");\n }\n\nInspection ID: UseOfPropertiesAsHashtable"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfPropertiesAsHashtable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCoupling",
+ "shortDescription": {
+ "text": "Overly coupled method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that reference too many other classes. Methods with too high coupling can be very fragile and should be probably split into smaller methods. Each referenced class is counted only once no matter how many times it is referenced. Configure the inspection: Use the Method coupling limit field to specify the maximum allowed coupling for a method. Use the Include couplings to java system classes option to count references to classes from 'java'or 'javax' packages. Use the Include couplings to library classes option to count references to third-party library classes. Inspection ID: MethodCoupling",
+ "markdown": "Reports methods that reference too many other classes. Methods with too high coupling can be very fragile and should be probably split into smaller methods.\n\nEach referenced class is counted only once no matter how many times it is referenced.\n\nConfigure the inspection:\n\n* Use the **Method coupling limit** field to specify the maximum allowed coupling for a method.\n* Use the **Include couplings to java system classes** option to count references to classes from `java`or `javax` packages.\n* Use the **Include couplings to library classes** option to count references to third-party library classes.\n\nInspection ID: MethodCoupling"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyCoupledMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 141,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AccessToStaticFieldLockedOnInstance",
+ "shortDescription": {
+ "text": "Access to 'static' field locked on instance data"
+ },
+ "fullDescription": {
+ "text": "Reports access to non-constant static fields that are locked on either 'this' or an instance field of 'this'. Locking a static field on instance data does not prevent the field from being modified by other instances, and thus may result in unexpected race conditions. Example: 'static String test;\n public void foo() {\n synchronized (this) {\n System.out.println(test); // warning\n }\n }' There is a quick-fix that allows ignoring static fields of specific types. You can manage those ignored types in the inspection options. Use the inspection options to specify which classes used for static fields should be ignored. Inspection ID: AccessToStaticFieldLockedOnInstance",
+ "markdown": "Reports access to non-constant static fields that are locked on either `this` or an instance field of `this`.\n\n\nLocking a static field on instance data does not prevent the field from being\nmodified by other instances, and thus may result in unexpected race conditions.\n\n**Example:**\n\n\n static String test;\n public void foo() {\n synchronized (this) {\n System.out.println(test); // warning\n }\n }\n\n\nThere is a quick-fix that allows ignoring static fields of specific types.\nYou can manage those ignored types in the inspection options.\n\n\nUse the inspection options to specify which classes used for static fields should be ignored.\n\n\nInspection ID: AccessToStaticFieldLockedOnInstance"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessToStaticFieldLockedOnInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "VariableTypeCanBeExplicit",
+ "shortDescription": {
+ "text": "Variable type can be explicit"
+ },
+ "fullDescription": {
+ "text": "Reports local variables of the 'var' type that can be replaced with an explicit type. Example: 'var str = \"Hello\";' After the quick-fix is applied: 'String str = \"Hello\";' This inspection depends on the Java feature 'Local variable type inference', which is available since Java 10. Inspection ID: VariableTypeCanBeExplicit",
+ "markdown": "Reports local variables of the `var` type that can be replaced with an explicit type.\n\n**Example:**\n\n\n var str = \"Hello\";\n\nAfter the quick-fix is applied:\n\n\n String str = \"Hello\";\n\nThis inspection depends on the Java feature 'Local variable type inference', which is available since Java 10.\n\nInspection ID: VariableTypeCanBeExplicit"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "VariableTypeCanBeExplicit",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 10",
+ "index": 168,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java8ListSort",
+ "shortDescription": {
+ "text": "'Collections.sort()' can be replaced with 'List.sort()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls of 'Collections.sort(list, comparator)' which can be replaced with 'list.sort(comparator)'. 'Collections.sort' is just a wrapper, so it is better to use an instance method directly. This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8ListSort",
+ "markdown": "Reports calls of `Collections.sort(list, comparator)` which can be replaced with `list.sort(comparator)`.\n\n`Collections.sort` is just a wrapper, so it is better to use an instance method directly.\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8ListSort"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java8ListSort",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparatorCombinators",
+ "shortDescription": {
+ "text": "'Comparator' combinator can be used"
+ },
+ "fullDescription": {
+ "text": "Reports 'Comparator' instances defined as lambda expressions that could be expressed using 'Comparator.comparing()' calls. Chained comparisons which can be replaced by 'Comparator.thenComparing()' expression are also reported. Example: 'myList.sort((person1, person2) -> person1.getName().compareTo(person2.getName()));\n\n myList2.sort((person1, person2) -> {\n int res = person1.first().compareTo(person2.first());\n if(res == 0) res = person1.second().compareTo(person2.second());\n if(res == 0) res = person1.third() - person2.third();\n return res;\n });' After the quick-fixes are applied: 'myList.sort(Comparator.comparing(Person::getName));\n\n myList2.sort(Comparator.comparing(Person::first)\n .thenComparing(Person::second)\n .thenComparingInt(Person::third));' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: ComparatorCombinators",
+ "markdown": "Reports `Comparator` instances defined as lambda expressions that could be expressed using `Comparator.comparing()` calls. Chained comparisons which can be replaced by `Comparator.thenComparing()` expression are also reported.\n\nExample:\n\n\n myList.sort((person1, person2) -> person1.getName().compareTo(person2.getName()));\n\n myList2.sort((person1, person2) -> {\n int res = person1.first().compareTo(person2.first());\n if(res == 0) res = person1.second().compareTo(person2.second());\n if(res == 0) res = person1.third() - person2.third();\n return res;\n });\n\nAfter the quick-fixes are applied:\n\n\n myList.sort(Comparator.comparing(Person::getName));\n\n myList2.sort(Comparator.comparing(Person::first)\n .thenComparing(Person::second)\n .thenComparingInt(Person::third));\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: ComparatorCombinators"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparatorCombinators",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractMethodCallInConstructor",
+ "shortDescription": {
+ "text": "Abstract method called during object construction"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'abstract' methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }' This inspection shares the functionality with the following inspections: Overridable method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication. Inspection ID: AbstractMethodCallInConstructor",
+ "markdown": "Reports calls to `abstract` methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n\nSuch calls may result in subtle bugs, as object initialization may happen before the method call.\n\n**Example:**\n\n\n abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }\n\nThis inspection shares the functionality with the following inspections:\n\n* Overridable method called during object construction\n* Overridden method called during object construction\n\nOnly one inspection should be enabled at once to prevent warning duplication.\n\nInspection ID: AbstractMethodCallInConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractMethodCallInConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsReplaceableByObjectsCall",
+ "shortDescription": {
+ "text": "'equals()' expression replaceable by 'Objects.equals()' expression"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that can be replaced with a call to 'java.util.Objects#equals'. Example: 'void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }' After the quick-fix is applied: 'void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }' Replacing expressions like 'a != null && a.equals(b)' with 'Objects.equals(a, b)' slightly changes the semantics. Use the Highlight expressions like 'a != null && a.equals(b)' option to enable or disable this behavior. This inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7. Inspection ID: EqualsReplaceableByObjectsCall",
+ "markdown": "Reports expressions that can be replaced with a call to `java.util.Objects#equals`.\n\n**Example:**\n\n\n void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }\n\n\nReplacing expressions like `a != null && a.equals(b)` with `Objects.equals(a, b)`\nslightly changes the semantics. Use the **Highlight expressions like 'a != null \\&\\& a.equals(b)'** option to enable or disable this behavior.\n\nThis inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7.\n\nInspection ID: EqualsReplaceableByObjectsCall"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "EqualsReplaceableByObjectsCall",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 7",
+ "index": 170,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TailRecursion",
+ "shortDescription": {
+ "text": "Tail recursion"
+ },
+ "fullDescription": {
+ "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }' Inspection ID: TailRecursion",
+ "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n\nInspection ID: TailRecursion"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "TailRecursion",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringEqualsEmptyString",
+ "shortDescription": {
+ "text": "'String.equals()' can be replaced with 'String.isEmpty()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' being called to compare a 'String' with an empty string. In this case, using '.isEmpty()' is better as it shows you exactly what you're checking. Example: 'void checkString(String s){\n if (\"\".equals(s)) throw new IllegalArgumentException();\n }' After the quick-fix is applied: 'void checkString(String s){\n if (s != null && s.isEmpty()) throw new IllegalArgumentException();\n }' '\"\".equals(str)' returns false when 'str' is null. For safety, this inspection's quick-fix inserts an explicit null-check when the 'equals()' argument is nullable. Use the option to make the inspection ignore such cases. Inspection ID: StringEqualsEmptyString",
+ "markdown": "Reports `equals()` being called to compare a `String` with an empty string. In this case, using `.isEmpty()` is better as it shows you exactly what you're checking.\n\n**Example:**\n\n\n void checkString(String s){\n if (\"\".equals(s)) throw new IllegalArgumentException();\n }\n\nAfter the quick-fix is applied:\n\n\n void checkString(String s){\n if (s != null && s.isEmpty()) throw new IllegalArgumentException();\n }\n\n\n`\"\".equals(str)` returns false when `str` is null. For safety, this inspection's quick-fix inserts an explicit\nnull-check when\nthe `equals()` argument is nullable. Use the option to make the inspection ignore such cases.\n\nInspection ID: StringEqualsEmptyString"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringEqualsEmptyString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PreviewFeature",
+ "shortDescription": {
+ "text": "Preview Feature warning"
+ },
+ "fullDescription": {
+ "text": "Reports usages of Preview Feature APIs, i.e. of a module, package, class, interface, method, constructor, field, or enum constant in the 'java.*' or 'javax.*' namespace annotated with '@PreviewFeature'. A preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented, and is yet impermanent. The notion of a preview feature is defined in JEP 12. If some piece of code depends on a preview API, it may stop compiling in future JDK versions if the feature is changed or removed. The inspection only reports if the language level of the project or module is Preview. Inspection ID: PreviewFeature New in 2021.1",
+ "markdown": "Reports usages of Preview Feature APIs, i.e. of a module, package, class, interface, method, constructor, field, or enum constant in the `java.*` or `javax.*` namespace annotated with `@PreviewFeature`.\n\n\nA preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented,\nand is yet impermanent. The notion of a preview feature is defined in [JEP 12](https://openjdk.org/jeps/12).\n\n\nIf some piece of code depends on a preview API, it may stop compiling in future JDK versions if the feature is changed or removed.\n\nThe inspection only reports if the language level of the project or module is **Preview**.\n\nInspection ID: PreviewFeature\n\nNew in 2021.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "preview",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Compiler issues",
+ "index": 171,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TooBroadThrows",
+ "shortDescription": {
+ "text": "Overly broad 'throws' clause"
+ },
+ "fullDescription": {
+ "text": "Reports 'throws' clauses with exceptions that are more generic than the exceptions that the method actually throws. Example: 'public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }' After the quick-fix is applied: 'public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }' Configure the inspection: Use the Maximum number of hidden exceptions to warn field to ignore exceptions, that hide a larger number of other exceptions than specified. Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions declared on methods overriding a library method option to ignore overly broad 'throws' clauses in methods that override a library method. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad. Inspection ID: TooBroadThrows",
+ "markdown": "Reports `throws` clauses with exceptions that are more generic than the exceptions that the method actually throws.\n\n**Example:**\n\n\n public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nAfter the quick-fix is applied:\n\n\n public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nConfigure the inspection:\n\n* Use the **Maximum number of hidden exceptions to warn** field to ignore exceptions, that hide a larger number of other exceptions than specified.\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore overly broad `throws` clauses in methods that override a library method.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad.\n\nInspection ID: TooBroadThrows"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyBroadThrowsClause",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ImplicitSubclassInspection",
+ "shortDescription": {
+ "text": "Final declaration can't be overridden at runtime"
+ },
+ "fullDescription": {
+ "text": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime. Typical examples of necessary but impossible subclassing: 'final' classes marked with framework-specific annotations (for example, Spring '@Configuration') 'final', 'static' or 'private' methods marked with framework-specific annotations (for example, Spring '@Transactional') methods marked with framework-specific annotations inside 'final' classes The list of reported cases depends on the frameworks used. Inspection ID: ImplicitSubclassInspection",
+ "markdown": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime.\n\nTypical examples of necessary but impossible subclassing:\n\n* `final` classes marked with framework-specific annotations (for example, Spring `@Configuration`)\n* `final`, `static` or `private` methods marked with framework-specific annotations (for example, Spring `@Transactional`)\n* methods marked with framework-specific annotations inside `final` classes\n\nThe list of reported cases depends on the frameworks used.\n\nInspection ID: ImplicitSubclassInspection"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "ImplicitSubclassInspection",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectEqualsCanBeEquality",
+ "shortDescription": {
+ "text": "'equals()' call can be replaced with '=='"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'equals()' that can be replaced by '==' or '!=' expressions without a change in semantics. These calls can be replaced when they are used to compare 'final' classes that don't have their own 'equals()' implementation but use the default 'Object.equals()'. This replacement may result in better performance. There is a separate inspection for 'equals()' calls on 'enum' values: 'equals()' called on Enum value. Inspection ID: ObjectEqualsCanBeEquality",
+ "markdown": "Reports calls to `equals()` that can be replaced by `==` or `!=` expressions without a change in semantics.\n\nThese calls can be replaced when they are used to compare `final` classes that don't have their own `equals()` implementation but use the default `Object.equals()`.\nThis replacement may result in better performance.\n\nThere is a separate inspection for `equals()` calls on `enum` values: 'equals()' called on Enum value.\n\nInspection ID: ObjectEqualsCanBeEquality"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ObjectEqualsCanBeEquality",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JDBCPrepareStatementWithNonConstantString",
+ "shortDescription": {
+ "text": "Call to 'Connection.prepare*()' with non-constant string"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.sql.Connection.prepareStatement()', 'java.sql.Connection.prepareCall()', or any of their variants which take a dynamically-constructed string as the statement to prepare. Constructed SQL statements are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");' Use the inspection settings to consider any 'static' 'final' fields as constants. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";' Inspection ID: JDBCPrepareStatementWithNonConstantString",
+ "markdown": "Reports calls to `java.sql.Connection.prepareStatement()`, `java.sql.Connection.prepareCall()`, or any of their variants which take a dynamically-constructed string as the statement to prepare.\n\n\nConstructed SQL statements are a common source of\nsecurity breaches. By default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");\n\nUse the inspection settings to consider any `static` `final` fields as constants. Be careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";\n\nInspection ID: JDBCPrepareStatementWithNonConstantString"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JDBCPrepareStatementWithNonConstantString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemProperties",
+ "shortDescription": {
+ "text": "Access of system properties"
+ },
+ "fullDescription": {
+ "text": "Reports code that accesses system properties using one of the following methods: 'System.getProperties()', 'System.setProperty()', 'System.setProperties()', 'System.clearProperties()' 'Integer.getInteger()' 'Boolean.getBoolean()' While accessing the system properties is not a security risk in itself, it is often found in malicious code. Code that accesses system properties should be closely examined in any security audit. Inspection ID: SystemProperties",
+ "markdown": "Reports code that accesses system properties using one of the following methods:\n\n* `System.getProperties()`, `System.setProperty()`, `System.setProperties()`, `System.clearProperties()`\n* `Integer.getInteger()`\n* `Boolean.getBoolean()`\n\n\nWhile accessing the system properties is not a security risk in itself, it is often found in malicious code.\nCode that accesses system properties should be closely examined in any security audit.\n\nInspection ID: SystemProperties"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessOfSystemProperties",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InvalidComparatorMethodReference",
+ "shortDescription": {
+ "text": "Invalid method reference used for 'Comparator'"
+ },
+ "fullDescription": {
+ "text": "Reports method references mapped to the 'Comparator' interface that don't fulfill its contract. Some method references, like 'Integer::max', can be mapped to the 'Comparator' interface. However, using them as 'Comparator' is meaningless and the result might be unpredictable. Example: 'ArrayList ints = foo();\n ints.sort(Math::min);' After the quick-fix is applied: 'ArrayList ints = foo();\n ints.sort(Comparator.reverseOrder());' Inspection ID: InvalidComparatorMethodReference",
+ "markdown": "Reports method references mapped to the `Comparator` interface that don't fulfill its contract.\n\n\nSome method references, like `Integer::max`, can be mapped to the `Comparator` interface.\nHowever, using them as `Comparator` is meaningless and the result might be unpredictable.\n\nExample:\n\n\n ArrayList ints = foo();\n ints.sort(Math::min);\n\nAfter the quick-fix is applied:\n\n\n ArrayList ints = foo();\n ints.sort(Comparator.reverseOrder());\n\nInspection ID: InvalidComparatorMethodReference"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InvalidComparatorMethodReference",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9ModuleExportsPackageToItself",
+ "shortDescription": {
+ "text": "Module exports/opens package to itself"
+ },
+ "fullDescription": {
+ "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: Java9ModuleExportsPackageToItself",
+ "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: Java9ModuleExportsPackageToItself"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9ModuleExportsPackageToItself",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ToArrayCallWithZeroLengthArrayArgument",
+ "shortDescription": {
+ "text": "'Collection.toArray()' call style"
+ },
+ "fullDescription": {
+ "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style. Inspection ID: ToArrayCallWithZeroLengthArrayArgument",
+ "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style.\n\nInspection ID: ToArrayCallWithZeroLengthArrayArgument"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggerInitializedWithForeignClass",
+ "shortDescription": {
+ "text": "Logger initialized with foreign class"
+ },
+ "fullDescription": {
+ "text": "Reports 'Logger' instances that are initialized with a 'class' literal from a different class than the 'Logger' is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly. A quick-fix is provided to replace the foreign class literal with one from the surrounding class. Example: 'public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }' After the quick-fix is applied: 'public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }' Configure the inspection: Use the table to specify the logger factory classes and logger factory methods recognized by this inspection. Use the Ignore loggers initialized with a superclass option to ignore loggers that are initialized with a superclass of the class containing the logger. Use the Ignore loggers in non-public classes to only warn on loggers in 'public' classes. Use the Ignore loggers not initialized in a final field to only report loggers initialized in a final field, other cases will be ignored. Inspection ID: LoggerInitializedWithForeignClass",
+ "markdown": "Reports `Logger` instances that are initialized with a `class` literal from a different class than the `Logger` is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly.\n\nA quick-fix is provided to replace the foreign class literal with one from the surrounding class.\n\n**Example:**\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }\n\nAfter the quick-fix is applied:\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the logger factory classes and logger factory methods recognized by this inspection.\n* Use the **Ignore loggers initialized with a superclass** option to ignore loggers that are initialized with a superclass of the class containing the logger.\n* Use the **Ignore loggers in non-public classes** to only warn on loggers in `public` classes.\n* Use the **Ignore loggers not initialized in a final field** to only report loggers initialized in a final field, other cases will be ignored.\n\nInspection ID: LoggerInitializedWithForeignClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LoggerInitializedWithForeignClass",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 120,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MarkerInterface",
+ "shortDescription": {
+ "text": "Marker interface"
+ },
+ "fullDescription": {
+ "text": "Reports marker interfaces without any methods or fields. Such interfaces may be confusing and typically indicate a design failure. The inspection ignores interfaces that extend two or more interfaces and interfaces that specify the generic type of their superinterface. Inspection ID: MarkerInterface",
+ "markdown": "Reports marker interfaces without any methods or fields.\n\nSuch interfaces may be confusing and typically indicate a design failure.\n\nThe inspection ignores interfaces that extend two or more interfaces and interfaces\nthat specify the generic type of their superinterface.\n\nInspection ID: MarkerInterface"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MarkerInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CommentedOutCode",
+ "shortDescription": {
+ "text": "Commented out code"
+ },
+ "fullDescription": {
+ "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3 Inspection ID: CommentedOutCode",
+ "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3\n\nInspection ID: CommentedOutCode"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "CommentedOutCode",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 58,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SortedCollectionWithNonComparableKeys",
+ "shortDescription": {
+ "text": "Sorted collection with non-comparable elements"
+ },
+ "fullDescription": {
+ "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3 Inspection ID: SortedCollectionWithNonComparableKeys",
+ "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3\n\nInspection ID: SortedCollectionWithNonComparableKeys"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SortedCollectionWithNonComparableKeys",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithoutLogger",
+ "shortDescription": {
+ "text": "Class without logger"
+ },
+ "fullDescription": {
+ "text": "Reports classes which do not have a declared logger. Ensuring that every class has a dedicated logger is an important step in providing a unified logging implementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection. For example: 'public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }' Use the table in the Options section to specify logger class names. Classes which do not declare a field with the type of one of the specified classes will be reported by this inspection. Inspection ID: ClassWithoutLogger",
+ "markdown": "Reports classes which do not have a declared logger.\n\nEnsuring that every class has a dedicated logger is an important step in providing a unified logging\nimplementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.\n\nFor example:\n\n\n public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }\n\n\nUse the table in the **Options** section to specify logger class names.\nClasses which do not declare a field with the type of one of the specified classes will be reported by this inspection.\n\nInspection ID: ClassWithoutLogger"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithoutLogger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 120,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnOfInnerClass",
+ "shortDescription": {
+ "text": "Return of instance of anonymous, local or inner class"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements that return an instance of an anonymous, local, or inner class. Such instances keep an implicit reference to the outer instance, which can prevent the outer instance from being garbage-collected. Any caller of a method returning such an instance might cause a memory leak by holding on to the instance returned. Configure the inspection: Use the Ignore returns from non-public methods option to ignore returns from 'protected' or package-private methods. Returns from 'private' methods are always ignored. Inspection ID: ReturnOfInnerClass",
+ "markdown": "Reports `return` statements that return an instance of an anonymous, local, or inner class. Such instances keep an implicit reference to the outer instance, which can prevent the outer instance from being garbage-collected. Any caller of a method returning such an instance might cause a memory leak by holding on to the instance returned.\n\n\nConfigure the inspection:\n\n* Use the **Ignore returns from non-public methods** option to ignore returns from `protected` or package-private methods. Returns from `private` methods are always ignored.\n\nInspection ID: ReturnOfInnerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReturnOfInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 175,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousClassComplexity",
+ "shortDescription": {
+ "text": "Overly complex anonymous class"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous inner classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Anonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes. Use the Cyclomatic complexity limit field to specify the maximum allowed complexity for a class. Inspection ID: AnonymousClassComplexity",
+ "markdown": "Reports anonymous inner classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nAnonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes.\n\nUse the **Cyclomatic complexity limit** field to specify the maximum allowed complexity for a class.\n\nInspection ID: AnonymousClassComplexity"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexAnonymousInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 127,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitWithoutCorrespondingNotify",
+ "shortDescription": {
+ "text": "'wait()' without corresponding 'notify()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Object.wait()', for which no call to the corresponding 'Object.notify()' or 'Object.notifyAll()' can be found. This inspection only reports calls with qualifiers referencing fields of the current class. Example: 'public class Foo {\n public Object foo = new Object();\n\n void bar() throws InterruptedException {\n this.foo.wait();\n }\n }' Inspection ID: WaitWithoutCorrespondingNotify",
+ "markdown": "Reports calls to `Object.wait()`, for which no call to the corresponding `Object.notify()` or `Object.notifyAll()` can be found.\n\nThis inspection only reports calls with qualifiers referencing fields of the current class.\n\n**Example:**\n\n\n public class Foo {\n public Object foo = new Object();\n\n void bar() throws InterruptedException {\n this.foo.wait();\n }\n }\n\nInspection ID: WaitWithoutCorrespondingNotify"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitWithoutCorrespondingNotify",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfAWTPeerClass",
+ "shortDescription": {
+ "text": "Use of AWT peer class"
+ },
+ "fullDescription": {
+ "text": "Reports uses of AWT peer classes. Such classes represent native windowing system widgets, and will be non-portable between different windowing systems. Example: 'import java.awt.peer.ButtonPeer;\n\n abstract class Sample implements ButtonPeer {\n public void foo() {\n Sample sample;\n }\n }' Inspection ID: UseOfAWTPeerClass",
+ "markdown": "Reports uses of AWT peer classes. Such classes represent native windowing system widgets, and will be non-portable between different windowing systems.\n\n**Example:**\n\n\n import java.awt.peer.ButtonPeer;\n\n abstract class Sample implements ButtonPeer {\n public void foo() {\n Sample sample;\n }\n }\n\nInspection ID: UseOfAWTPeerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfAWTPeerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 93,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantExplicitVariableType",
+ "shortDescription": {
+ "text": "Local variable type can be omitted"
+ },
+ "fullDescription": {
+ "text": "Reports redundant local variable types. These types can be inferred from the context and thus replaced with 'var'. Example: 'void test(InputStream s) {\n try (InputStream in = s) {}\n }' After the fix is applied: 'void test(InputStream s) {\n try (var in = s) {}\n }' This inspection depends on the Java feature 'Local variable type inference', which is available since Java 10. Inspection ID: RedundantExplicitVariableType",
+ "markdown": "Reports redundant local variable types.\n\nThese types can be inferred from the context and thus replaced with `var`.\n\n**Example:**\n\n\n void test(InputStream s) {\n try (InputStream in = s) {}\n }\n\nAfter the fix is applied:\n\n\n void test(InputStream s) {\n try (var in = s) {}\n }\n\n\nThis inspection depends on the Java feature 'Local variable type inference', which is available since Java 10.\n\nInspection ID: RedundantExplicitVariableType"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "RedundantExplicitVariableType",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 10",
+ "index": 168,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableWithUnconstructableAncestor",
+ "shortDescription": {
+ "text": "Serializable class with unconstructable ancestor"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes whose closest non-serializable ancestor doesn't have a no-argument constructor. Such classes cannot be deserialized and will fail with an 'InvalidClassException'. Example: 'class Ancestor {\n private String name;\n Ancestor(String name) {\n this.name = name;\n }\n }\n\n // warning on this class because the superclass is not\n // serializable, and its constructor takes arguments\n class Descendant extends Ancestor implements Serializable {\n Descendant() {\n super(\"Bob\");\n }\n }' Inspection ID: SerializableWithUnconstructableAncestor",
+ "markdown": "Reports `Serializable` classes whose closest non-serializable ancestor doesn't have a no-argument constructor. Such classes cannot be deserialized and will fail with an `InvalidClassException`.\n\n**Example:**\n\n\n class Ancestor {\n private String name;\n Ancestor(String name) {\n this.name = name;\n }\n }\n\n // warning on this class because the superclass is not\n // serializable, and its constructor takes arguments\n class Descendant extends Ancestor implements Serializable {\n Descendant() {\n super(\"Bob\");\n }\n }\n\nInspection ID: SerializableWithUnconstructableAncestor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableClassWithUnconstructableAncestor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExcessiveLambdaUsage",
+ "shortDescription": {
+ "text": "Excessive lambda usage"
+ },
+ "fullDescription": {
+ "text": "Reports if a trivial lambda expression is used in cases in which there's an alternative method that behaves in the same way, but accepts a concrete value instead of a lambda. This inspection helps simplify the code. Example: 'Optional.orElseGet(() -> null)' After the quick-fix is applied: 'Optional.orElse(null)' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: ExcessiveLambdaUsage New in 2017.1",
+ "markdown": "Reports if a trivial lambda expression is used in cases in which there's an alternative method that behaves in the same way, but accepts a concrete value instead of a lambda.\n\nThis inspection helps simplify the code.\n\nExample:\n\n\n Optional.orElseGet(() -> null)\n\nAfter the quick-fix is applied:\n\n\n Optional.orElse(null)\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: ExcessiveLambdaUsage\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExcessiveLambdaUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterHidingMemberVariable",
+ "shortDescription": {
+ "text": "Parameter hides field"
+ },
+ "fullDescription": {
+ "text": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended. A quick-fix is suggested to rename the parameter. Example: 'class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }' You can configure the following options for this inspection: Ignore for property setters - ignore parameters of simple setters. Ignore superclass fields not visible from subclass - ignore 'private' fields in a superclass, which are not visible from the method. Ignore for constructors - ignore parameters of constructors. Ignore for abstract methods - ignore parameters of abstract methods. Ignore for static method parameters hiding instance fields - ignore parameters of 'static' methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing. Inspection ID: ParameterHidingMemberVariable",
+ "markdown": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended.\n\nA quick-fix is suggested to rename the parameter.\n\n**Example:**\n\n\n class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }\n \n\nYou can configure the following options for this inspection:\n\n1. **Ignore for property setters** - ignore parameters of simple setters.\n2. **Ignore superclass fields not visible from subclass** - ignore `private` fields in a superclass, which are not visible from the method.\n3. **Ignore for constructors** - ignore parameters of constructors.\n4. **Ignore for abstract methods** - ignore parameters of abstract methods.\n5. **Ignore for static method parameters hiding instance fields** - ignore parameters of `static` methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing.\n\nInspection ID: ParameterHidingMemberVariable"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterHidesMemberVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaBodyCanBeCodeBlock",
+ "shortDescription": {
+ "text": "Lambda body can be code block"
+ },
+ "fullDescription": {
+ "text": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks. Example: 'n -> n + 1' After the quick-fix is applied: 'n -> {\n return n + 1;\n}' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaBodyCanBeCodeBlock",
+ "markdown": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks.\n\nExample:\n\n\n n -> n + 1\n\nAfter the quick-fix is applied:\n\n n -> {\n return n + 1;\n }\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaBodyCanBeCodeBlock"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LambdaBodyCanBeCodeBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CustomSecurityManager",
+ "shortDescription": {
+ "text": "Custom 'SecurityManager'"
+ },
+ "fullDescription": {
+ "text": "Reports user-defined subclasses of 'java.lang.SecurityManager'. While not necessarily representing a security hole, such classes should be thoroughly and professionally inspected for possible security issues. Example: 'class CustomSecurityManager extends SecurityManager {\n }' Inspection ID: CustomSecurityManager",
+ "markdown": "Reports user-defined subclasses of `java.lang.SecurityManager`.\n\n\nWhile not necessarily representing a security hole, such classes should be thoroughly\nand professionally inspected for possible security issues.\n\n**Example:**\n\n\n class CustomSecurityManager extends SecurityManager {\n }\n\nInspection ID: CustomSecurityManager"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CustomSecurityManager",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TimeToString",
+ "shortDescription": {
+ "text": "Call to 'Time.toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'toString()' calls on 'java.sql.Time' objects. Such calls are usually incorrect in an internationalized environment. Inspection ID: TimeToString",
+ "markdown": "Reports `toString()` calls on `java.sql.Time` objects. Such calls are usually incorrect in an internationalized environment.\n\nInspection ID: TimeToString"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToTimeToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 7,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectEquality",
+ "shortDescription": {
+ "text": "Object comparison using '==', instead of 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports code that uses '==' or '!=' rather than 'equals()' to test for object equality. Comparing objects using '==' or '!=' is often a bug, because it compares objects by identity instead of equality. Comparisons to 'null' are not reported. Array, 'String' and 'Number' comparisons are reported by separate inspections. Example: 'if (list1 == list2) {\n return;\n }' After the quick-fix is applied: 'if (Objects.equals(list1, list2)) {\n return;\n }' Use the inspection settings to configure exceptions for this inspection. Inspection ID: ObjectEquality",
+ "markdown": "Reports code that uses `==` or `!=` rather than `equals()` to test for object equality.\n\n\nComparing objects using `==` or `!=` is often a bug,\nbecause it compares objects by identity instead of equality.\nComparisons to `null` are not reported.\n\n\nArray, `String` and `Number` comparisons are reported by separate inspections.\n\n**Example:**\n\n if (list1 == list2) {\n return;\n }\n\nAfter the quick-fix is applied:\n\n if (Objects.equals(list1, list2)) {\n return;\n }\n\nUse the inspection settings to configure exceptions for this inspection.\n\nInspection ID: ObjectEquality"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ObjectEquality",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PatternVariablesCanBeReplacedWithCast",
+ "shortDescription": {
+ "text": "Using 'instanceof' with patterns"
+ },
+ "fullDescription": {
+ "text": "Reports 'instanceof' with patterns and suggests converting them to ordinary 'instanceof' with casts. This inspection makes it possible to move 'instanceof' with patterns to a codebase using an earlier Java version by applying the quick-fix. Note that the result can be not completely equivalent to the original 'instanceof' with patterns when a complex expression before 'instanceof' is used. In this case this expression will be reevaluated. Example: 'if (object instanceof String txt && txt.length() == 1) {\n System.out.println(txt);\n } else {\n return;\n }\n System.out.println(txt);' After the quick-fix is applied: 'if (object instanceof String && ((String) object).length() ==1) {\n String txt = (String) object;\n System.out.println(txt);\n } else {\n return;\n }\n String txt = (String) object;\n System.out.println(txt);' Inspection ID: PatternVariablesCanBeReplacedWithCast New in 2023.1",
+ "markdown": "Reports `instanceof` with patterns and suggests converting them to ordinary `instanceof` with casts.\n\nThis inspection makes it possible to move `instanceof` with patterns to a codebase using an earlier Java version\nby applying the quick-fix.\n\n\nNote that the result can be not completely equivalent to the original `instanceof` with patterns when\na complex expression before `instanceof` is used. In this case this expression will be reevaluated.\n\nExample:\n\n\n if (object instanceof String txt && txt.length() == 1) {\n System.out.println(txt);\n } else {\n return;\n }\n System.out.println(txt);\n\nAfter the quick-fix is applied:\n\n\n if (object instanceof String && ((String) object).length() ==1) {\n String txt = (String) object;\n System.out.println(txt);\n } else {\n return;\n }\n String txt = (String) object;\n System.out.println(txt);\n\nInspection ID: PatternVariablesCanBeReplacedWithCast\n\nNew in 2023.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "PatternVariablesCanBeReplacedWithCast",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ManualArrayToCollectionCopy",
+ "shortDescription": {
+ "text": "Manual array to collection copy"
+ },
+ "fullDescription": {
+ "text": "Reports code that uses a loop to copy the contents of an array into a collection. A shorter and potentially faster (depending on the collection implementation) way to do this is using 'Collection.addAll(Arrays.asList())' or 'Collections.addAll()'. Only loops without additional statements inside are reported. Example: 'void addAll(List list, String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n String s = arr[i];\n list.add(s);\n }\n }' After the quick-fix is applied: 'void addAll(List list, String[] arr) {\n Collections.addAll(list, arr);\n }' Inspection ID: ManualArrayToCollectionCopy",
+ "markdown": "Reports code that uses a loop to copy the contents of an array into a collection.\n\n\nA shorter and potentially faster (depending on the collection implementation) way to do this is using `Collection.addAll(Arrays.asList())` or `Collections.addAll()`.\n\n\nOnly loops without additional statements inside are reported.\n\n**Example:**\n\n\n void addAll(List list, String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n String s = arr[i];\n list.add(s);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void addAll(List list, String[] arr) {\n Collections.addAll(list, arr);\n }\n\n\nInspection ID: ManualArrayToCollectionCopy"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ManualArrayToCollectionCopy",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchLabeledRuleCanBeCodeBlock",
+ "shortDescription": {
+ "text": "Labeled switch rule can have code block"
+ },
+ "fullDescription": {
+ "text": "Reports rules of 'switch' expressions or enhanced 'switch' statements with an expression body. These can be converted to code blocks. Example: 'String message = switch (errorCode) {\n case 404 -> \"Not found!\";\n ...\n };' After the quick-fix is applied: 'String message = switch (errorCode) {\n case 404 -> {\n yield \"Not found!\";\n }\n ...\n };' This inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14. Inspection ID: SwitchLabeledRuleCanBeCodeBlock New in 2019.1",
+ "markdown": "Reports rules of `switch` expressions or enhanced `switch` statements with an expression body. These can be converted to code blocks.\n\nExample:\n\n\n String message = switch (errorCode) {\n case 404 -> \"Not found!\";\n ...\n };\n\nAfter the quick-fix is applied:\n\n\n String message = switch (errorCode) {\n case 404 -> {\n yield \"Not found!\";\n }\n ...\n };\n\nThis inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14.\n\nInspection ID: SwitchLabeledRuleCanBeCodeBlock\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SwitchLabeledRuleCanBeCodeBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaReflectionMemberAccess",
+ "shortDescription": {
+ "text": "Reflective access to non-existent or not visible class member"
+ },
+ "fullDescription": {
+ "text": "Reports reflective access to fields and methods that don't exist or aren't visible. Example: 'Field stringHashField() throws NoSuchFieldException {\n return String.class.getField(\"hash\");\n }' After the quick-fix is applied: 'Field stringHashField() throws NoSuchFieldException {\n return String.class.getDeclaredField(\"hash\");\n }' With a 'final' class, it's clear if there is a field or method with the specified name in the class. With non-'final' classes, it's possible that a subclass has a field or method with that name, so there could be false positives. Use the inspection's settings to get rid of such false positives everywhere or with specific classes. Inspection ID: JavaReflectionMemberAccess New in 2017.2",
+ "markdown": "Reports reflective access to fields and methods that don't exist or aren't visible.\n\nExample:\n\n\n Field stringHashField() throws NoSuchFieldException {\n return String.class.getField(\"hash\");\n }\n\nAfter the quick-fix is applied:\n\n\n Field stringHashField() throws NoSuchFieldException {\n return String.class.getDeclaredField(\"hash\");\n }\n\n\nWith a `final` class, it's clear if there is a field or method with the specified name in the class.\n\n\nWith non-`final` classes, it's possible that a subclass has a field or method with that name, so there could be false positives.\nUse the inspection's settings to get rid of such false positives everywhere or with specific classes.\n\nInspection ID: JavaReflectionMemberAccess\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaReflectionMemberAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Reflective access",
+ "index": 134,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObviousNullCheck",
+ "shortDescription": {
+ "text": "Null-check method is called with obviously non-null argument"
+ },
+ "fullDescription": {
+ "text": "Reports if a null-checking method (for example, 'Objects.requireNonNull' or 'Assert.assertNotNull') is called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate a programming error. Example: 'final String greeting = Objects.requireNonNull(\"Hi!\");' After the quick-fix is applied: 'final String greeting = \"Hi!\";' New in 2017.2 Inspection ID: ObviousNullCheck",
+ "markdown": "Reports if a null-checking method (for example, `Objects.requireNonNull` or `Assert.assertNotNull`) is called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate a programming error.\n\n**Example:**\n\n\n final String greeting = Objects.requireNonNull(\"Hi!\");\n\nAfter the quick-fix is applied:\n\n\n final String greeting = \"Hi!\";\n\nNew in 2017.2\n\nInspection ID: ObviousNullCheck"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ObviousNullCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerialVersionUIDNotStaticFinal",
+ "shortDescription": {
+ "text": "'serialVersionUID' field not declared 'private static final long'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes whose 'serialVersionUID' field is not declared 'private static final long'. Example: 'class SampleClass implements Serializable {\n private long serialVersionUID = 1; // field of a Serializable class is not declared 'private static final long'\n\n public SampleClass() {\n System.out.println(serialVersionUID);\n }\n }' Inspection ID: SerialVersionUIDNotStaticFinal",
+ "markdown": "Reports `Serializable` classes whose `serialVersionUID` field is not declared `private static final long`.\n\n**Example:**\n\n\n class SampleClass implements Serializable {\n private long serialVersionUID = 1; // field of a Serializable class is not declared 'private static final long'\n\n public SampleClass() {\n System.out.println(serialVersionUID);\n }\n }\n\nInspection ID: SerialVersionUIDNotStaticFinal"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerialVersionUIDWithWrongSignature",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassOnInterface",
+ "shortDescription": {
+ "text": "Inner class of interface"
+ },
+ "fullDescription": {
+ "text": "Reports inner classes in 'interface' classes. Some coding standards discourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces. Use the Ignore inner interfaces of interfaces option to ignore inner interfaces. For example: 'interface I {\n interface Inner {\n }\n }' Inspection ID: InnerClassOnInterface",
+ "markdown": "Reports inner classes in `interface` classes.\n\nSome coding standards\ndiscourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces.\n\n\nUse the **Ignore inner interfaces of interfaces** option to ignore inner interfaces. For example:\n\n\n interface I {\n interface Inner {\n }\n }\n\nInspection ID: InnerClassOnInterface"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassOfInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnusedLabel",
+ "shortDescription": {
+ "text": "Unused label"
+ },
+ "fullDescription": {
+ "text": "Reports labels that are not targets of any 'break' or 'continue' statements. Example: 'label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' After the quick-fix is applied, the label is removed: 'for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' Inspection ID: UnusedLabel",
+ "markdown": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nInspection ID: UnusedLabel"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnusedLabel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicFieldAccessedInSynchronizedContext",
+ "shortDescription": {
+ "text": "Non-private field accessed in 'synchronized' context"
+ },
+ "fullDescription": {
+ "text": "Reports non-'final', non-'private' fields that are accessed in a synchronized context. A non-'private' field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\" access may result in unexpectedly inconsistent data structures. Example: 'class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }' Inspection ID: PublicFieldAccessedInSynchronizedContext",
+ "markdown": "Reports non-`final`, non-`private` fields that are accessed in a synchronized context.\n\n\nA non-`private` field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\"\naccess may result in unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }\n\nInspection ID: PublicFieldAccessedInSynchronizedContext"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonPrivateFieldAccessedInSynchronizedContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForeachStatement",
+ "shortDescription": {
+ "text": "Enhanced 'for' statement"
+ },
+ "fullDescription": {
+ "text": "Reports enhanced 'for' statements. Example: 'for (int x: Arrays.asList(1, 2, 3)) {\n System.out.println(x);\n }' After the quick-fix is applied: 'for (Iterator iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {\n final int x = iterator.next();\n System.out.println(x);\n }' Enhanced 'for' statement appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: ForeachStatement",
+ "markdown": "Reports enhanced `for` statements.\n\nExample:\n\n\n for (int x: Arrays.asList(1, 2, 3)) {\n System.out.println(x);\n }\n\nAfter the quick-fix is applied:\n\n\n for (Iterator iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {\n final int x = iterator.next();\n System.out.println(x);\n }\n\n\n*Enhanced* `for` *statement* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: ForeachStatement"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForeachStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 153,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalUsedAsFieldOrParameterType",
+ "shortDescription": {
+ "text": "'Optional' used as field or parameter type"
+ },
+ "fullDescription": {
+ "text": "Reports any cases in which 'java.util.Optional', 'java.util.OptionalDouble', 'java.util.OptionalInt', 'java.util.OptionalLong', or 'com.google.common.base.Optional' are used as types for fields or parameters. 'Optional' was designed to provide a limited mechanism for library method return types in which a clear way to represent \"no result\" was needed. Using a field with the 'java.util.Optional' type is also problematic if the class needs to be 'Serializable', as 'java.util.Optional' is not serializable. Example: 'class MyClass {\n Optional name; // Optional field\n\n // Optional parameter\n void setName(Optional name) {\n this.name = name;\n }\n }' Inspection ID: OptionalUsedAsFieldOrParameterType",
+ "markdown": "Reports any cases in which `java.util.Optional`, `java.util.OptionalDouble`, `java.util.OptionalInt`, `java.util.OptionalLong`, or `com.google.common.base.Optional` are used as types for fields or parameters.\n\n`Optional` was designed to provide a limited mechanism for library method return types in which a clear way to represent \"no result\"\nwas needed.\n\nUsing a field with the `java.util.Optional` type is also problematic if the class needs to be\n`Serializable`, as `java.util.Optional` is not serializable.\n\nExample:\n\n\n class MyClass {\n Optional name; // Optional field\n\n // Optional parameter\n void setName(Optional name) {\n this.name = name;\n }\n }\n\nInspection ID: OptionalUsedAsFieldOrParameterType"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalUsedAsFieldOrParameterType",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 82,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReplaceAllDot",
+ "shortDescription": {
+ "text": "Suspicious regex expression argument"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'String.replaceAll()' or 'String.split()' where the first argument is a single regex meta character argument. The regex meta characters are one of '.$|()[{^?*+\\'. They have a special meaning in regular expressions. For example, calling '\"ab.cd\".replaceAll(\".\", \"-\")' produces '\"-----\"', because the dot matches any character. Most likely the escaped variant '\"\\\\.\"' was intended instead. Using 'File.separator' as a regex is also reported. The 'File.separator' has a platform specific value. It equals to '/' on Linux and Mac but equals to '\\' on Windows, which is not a valid regular expression, so such code is not portable. Example: 's.replaceAll(\".\", \"-\");' After the quick-fix is applied: 's.replaceAll(\"\\\\.\", \"-\");' Inspection ID: ReplaceAllDot",
+ "markdown": "Reports calls to `String.replaceAll()` or `String.split()` where the first argument is a single regex meta character argument.\n\n\nThe regex meta characters are one of `.$|()[{^?*+\\`. They have a special meaning in regular expressions.\nFor example, calling `\"ab.cd\".replaceAll(\".\", \"-\")` produces `\"-----\"`, because the dot matches any character.\nMost likely the escaped variant `\"\\\\.\"` was intended instead.\n\n\nUsing `File.separator` as a regex is also reported. The `File.separator` has a platform specific value. It\nequals to `/` on Linux and Mac but equals to `\\` on Windows, which is not a valid regular expression, so\nsuch code is not portable.\n\n**Example:**\n\n\n s.replaceAll(\".\", \"-\");\n\nAfter the quick-fix is applied:\n\n\n s.replaceAll(\"\\\\.\", \"-\");\n\n\nInspection ID: ReplaceAllDot"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousRegexArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForCanBeForeach",
+ "shortDescription": {
+ "text": "'for' loop can be replaced with enhanced for loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'for' loops that iterate over collections or arrays, and can be automatically replaced with an enhanced 'for' loop (foreach iteration syntax). Example: 'for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {\n String item = iterator.next();\n System.out.println(item);\n }' After the quick-fix is applied: 'for (String item : list) {\n System.out.println(item);\n }' Use the Report indexed 'java.util.List' loops option to find loops involving 'list.get(index)' calls. Generally, these loops can be replaced with enhanced 'for' loops, unless they modify an underlying list in the process, for example, by calling 'list.remove(index)'. If the latter is the case, the enhanced 'for' loop may throw 'ConcurrentModificationException'. Also, in some cases, 'list.get(index)' loops may work a little bit faster. Use the Do not report iterations over untyped collections option to ignore collections without type parameters. This prevents the creation of enhanced 'for' loop variables of the 'java.lang.Object' type and the insertion of casts where the loop variable is used. This inspection depends on the Java feature 'For-each loops', which is available since Java 5. Inspection ID: ForCanBeForeach",
+ "markdown": "Reports `for` loops that iterate over collections or arrays, and can be automatically replaced with an enhanced `for` loop (foreach iteration syntax).\n\n**Example:**\n\n\n for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {\n String item = iterator.next();\n System.out.println(item);\n }\n\nAfter the quick-fix is applied:\n\n\n for (String item : list) {\n System.out.println(item);\n }\n\n\nUse the **Report indexed 'java.util.List' loops** option to find loops involving `list.get(index)` calls.\nGenerally, these loops can be replaced with enhanced `for` loops,\nunless they modify an underlying list in the process, for example, by calling `list.remove(index)`.\nIf the latter is the case, the enhanced `for` loop may throw `ConcurrentModificationException`.\nAlso, in some cases, `list.get(index)` loops may work a little bit faster.\n\n\nUse the **Do not report iterations over untyped collections** option to ignore collections without type parameters.\nThis prevents the creation of enhanced `for` loop variables of the `java.lang.Object` type and the insertion of casts\nwhere the loop variable is used.\n\nThis inspection depends on the Java feature 'For-each loops', which is available since Java 5.\n\nInspection ID: ForCanBeForeach"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopReplaceableByForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageVisibleField",
+ "shortDescription": {
+ "text": "Package-visible field"
+ },
+ "fullDescription": {
+ "text": "Reports fields that are declared without any access modifier (also known as package-private). Constants (that is, fields marked 'static' and 'final') are not reported. Example: 'public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }' Inspection ID: PackageVisibleField",
+ "markdown": "Reports fields that are declared without any access modifier (also known as package-private).\n\nConstants (that is, fields marked `static` and `final`) are not reported.\n\n**Example:**\n\n\n public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }\n\nInspection ID: PackageVisibleField"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageVisibleField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 131,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstantiationOfUtilityClass",
+ "shortDescription": {
+ "text": "Instantiation of utility class"
+ },
+ "fullDescription": {
+ "text": "Reports instantiation of utility classes using the 'new' keyword. In utility classes, all fields and methods are 'static'. Instantiation of such classes is most likely unnecessary and indicates a mistake. Example: 'class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }' To prevent utility classes from being instantiated, it's recommended to use a 'private' constructor. Inspection ID: InstantiationOfUtilityClass",
+ "markdown": "Reports instantiation of utility classes using the `new` keyword.\n\n\nIn utility classes, all fields and methods are `static`.\nInstantiation of such classes is most likely unnecessary and indicates a mistake.\n\n**Example:**\n\n\n class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }\n\n\nTo prevent utility classes from being instantiated,\nit's recommended to use a `private` constructor.\n\nInspection ID: InstantiationOfUtilityClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstantiationOfUtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TrailingWhitespacesInTextBlock",
+ "shortDescription": {
+ "text": "Trailing whitespace in text block"
+ },
+ "fullDescription": {
+ "text": "Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler. Example (where spaces are indicated with dots): '..String.count.=.\"\"\"\n....one\n....two....\n....three\n....\"\"\";' Two quick-fixes are provided. One to remove the trailing whitespace, and one to escape the trailing whitespace so that it will not be removed by the compiler: '..String.count.=.\"\"\"\n....one\n....two...\\s\n....three\n....\"\"\";' This inspection depends on the Java feature 'Text block literals', which is available since Java 15. Inspection ID: TrailingWhitespacesInTextBlock New in 2021.1",
+ "markdown": "Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler.\n\n**Example (where spaces are indicated with dots):**\n\n\n ..String.count.=.\"\"\"\n ....one\n ....two....\n ....three\n ....\"\"\";\n\nTwo quick-fixes are provided.\nOne to remove the trailing whitespace, and one to escape the trailing whitespace so that it will not be removed by the compiler:\n\n\n ..String.count.=.\"\"\"\n ....one\n ....two...\\s\n ....three\n ....\"\"\";\n\nThis inspection depends on the Java feature 'Text block literals', which is available since Java 15.\n\nInspection ID: TrailingWhitespacesInTextBlock\n\nNew in 2021.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TrailingWhitespacesInTextBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NewClassNamingConvention",
+ "shortDescription": {
+ "text": "Class naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class produces a warning because the length of its name is 6, which is less than 8: 'public class MyTest{}'. A quick-fix that renames such classes is available only in the editor. Configure the inspection: Use the list in the Options section to specify which classes should be checked. Deselect the checkboxes for the classes for which you want to skip the check. For each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the provided input fields. Specify 0 in the length fields to skip corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: NewClassNamingConvention",
+ "markdown": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class\nproduces a warning because the length of its name is 6, which is less than 8: `public class MyTest{}`.\n\nA quick-fix that renames such classes is available only in the editor.\n\nConfigure the inspection:\n\n\nUse the list in the **Options** section to specify which classes should be checked. Deselect the checkboxes for the classes for which\nyou want to skip the check.\n\nFor each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the\nprovided input fields. Specify **0** in the length fields to skip corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: NewClassNamingConvention"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NewClassNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 77,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseCompareMethod",
+ "shortDescription": {
+ "text": "'compare()' method can be used to compare numbers"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that can be replaced by a call to the 'Integer.compare()' method or a similar method from the 'Long', 'Short', 'Byte', 'Double' or 'Float' classes, instead of more verbose or less efficient constructs. If 'x' and 'y' are boxed integers, then 'x.compareTo(y)' is suggested, if they are primitives 'Integer.compare(x, y)' is suggested. Example: 'public int compare(int x, int y) {\n return x > y ? 1 : x < y ? -1 : 0;\n }' After the quick-fix is applied: 'public int compare(int x, int y) {\n return Integer.compare(x, y);\n }' Note that 'Double.compare' and 'Float.compare' slightly change the code semantics. In particular, they make '-0.0' and '0.0' distinguishable ('Double.compare(-0.0, 0.0)' yields -1). Also, they consistently process 'NaN' value. In most of the cases, this semantics change actually improves the code. Use the checkbox to disable this inspection for floating point numbers if semantics change is unacceptable in your case. Inspection ID: UseCompareMethod New in 2017.2",
+ "markdown": "Reports expressions that can be replaced by a call to the `Integer.compare()` method or a similar method from the `Long`, `Short`, `Byte`, `Double` or `Float` classes, instead of more verbose or less efficient constructs.\n\nIf `x` and `y` are boxed integers, then `x.compareTo(y)` is suggested,\nif they are primitives `Integer.compare(x, y)` is suggested.\n\n**Example:**\n\n\n public int compare(int x, int y) {\n return x > y ? 1 : x < y ? -1 : 0;\n }\n\nAfter the quick-fix is applied:\n\n\n public int compare(int x, int y) {\n return Integer.compare(x, y);\n }\n\n\nNote that `Double.compare` and `Float.compare` slightly change the code semantics. In particular,\nthey make `-0.0` and `0.0` distinguishable (`Double.compare(-0.0, 0.0)` yields -1).\nAlso, they consistently process `NaN` value. In most of the cases, this semantics change actually improves the\ncode. Use the checkbox to disable this inspection for floating point numbers if semantics change is unacceptable\nin your case.\n\nInspection ID: UseCompareMethod\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseCompareMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids",
+ "index": 84,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MoveFieldAssignmentToInitializer",
+ "shortDescription": {
+ "text": "Field assignment can be moved to initializer"
+ },
+ "fullDescription": {
+ "text": "Suggests replacing initialization of fields using assignment with initialization in the field declaration. Only reports if the field assignment is located in an instance or static initializer, and joining it with the field declaration is likely to be safe. In other cases, like assignment inside a constructor, the quick-fix is provided without highlighting, as the fix may change the semantics. Example: 'class MyClass {\n static final int intConstant;\n \n static {\n intConstant = 10;\n }\n }' The quick fix moves the assigned value to the field initializer removing the class initializer if possible: 'class MyClass {\n static final int intConstant = 10;\n }' Since 2017.2 Inspection ID: MoveFieldAssignmentToInitializer",
+ "markdown": "Suggests replacing initialization of fields using assignment with initialization in the field declaration.\n\nOnly reports if the field assignment is located in an instance or static initializer, and\njoining it with the field declaration is likely to be safe.\nIn other cases, like assignment inside a constructor, the quick-fix is provided without highlighting,\nas the fix may change the semantics.\n\nExample:\n\n\n class MyClass {\n static final int intConstant;\n \n static {\n intConstant = 10;\n }\n }\n\nThe quick fix moves the assigned value to the field initializer removing the class initializer if possible:\n\n\n class MyClass {\n static final int intConstant = 10;\n }\n\nSince 2017.2\n\nInspection ID: MoveFieldAssignmentToInitializer"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MoveFieldAssignmentToInitializer",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationInFormatCall",
+ "shortDescription": {
+ "text": "String concatenation as argument to 'format()' call"
+ },
+ "fullDescription": {
+ "text": "Reports non-constant string concatenations used as a format string argument. While occasionally intended, this is usually a misuse of a formatting method and may even cause security issues if the variables used in the concatenated string contain special characters like '%'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }' Here, the 'userName' will be interpreted as a part of format string, which may result in 'IllegalFormatException' (for example, if 'userName' is '\"%\"') or in using an enormous amount of memory (for example, if 'userName' is '\"%2000000000%\"'). The call should be probably replaced with 'String.format(\"Hello, %s\", userName);'. This inspection checks calls to formatting methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter', or 'java.io.PrintStream'. Inspection ID: StringConcatenationInFormatCall",
+ "markdown": "Reports non-constant string concatenations used as a format string argument.\n\n\nWhile occasionally intended, this is usually a misuse of a formatting method\nand may even cause security issues if the variables used in the concatenated string\ncontain special characters like `%`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }\n\n\nHere, the `userName` will be interpreted as a part of format string, which may result\nin `IllegalFormatException` (for example, if `userName` is `\"%\"`) or\nin using an enormous amount of memory (for example, if `userName` is `\"%2000000000%\"`).\nThe call should be probably replaced with `String.format(\"Hello, %s\", userName);`.\n\n\nThis inspection checks calls to formatting methods on\n`java.util.Formatter`,\n`java.lang.String`,\n`java.io.PrintWriter`,\nor `java.io.PrintStream`.\n\nInspection ID: StringConcatenationInFormatCall"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenationInFormatCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitWhileHoldingTwoLocks",
+ "shortDescription": {
+ "text": "'wait()' while holding two locks"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()' methods that may occur while the current thread is holding two locks. Since calling 'wait()' only releases one lock on its target, waiting with two locks held can easily lead to a deadlock. Example: 'synchronized (lockA) {\n synchronized (lockB) {\n lockB.wait(); //warning\n //thread A is stuck here holding lockA\n }\n }\n\n synchronized (lockA) { //thread B can't enter the block and release thread A\n lockB.notify();\n }' Inspection ID: WaitWhileHoldingTwoLocks",
+ "markdown": "Reports calls to `wait()` methods that may occur while the current thread is holding two locks.\n\n\nSince calling `wait()` only releases one lock on its target,\nwaiting with two locks held can easily lead to a deadlock.\n\n**Example:**\n\n\n synchronized (lockA) {\n synchronized (lockB) {\n lockB.wait(); //warning\n //thread A is stuck here holding lockA\n }\n }\n\n synchronized (lockA) { //thread B can't enter the block and release thread A\n lockB.notify();\n }\n\nInspection ID: WaitWhileHoldingTwoLocks"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitWhileHoldingTwoLocks",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableInnerClassWithNonSerializableOuterClass",
+ "shortDescription": {
+ "text": "Serializable non-'static' inner class with non-Serializable outer class"
+ },
+ "fullDescription": {
+ "text": "Reports non-static inner classes that implement 'Serializable' and are declared inside a class that doesn't implement 'Serializable'. Such classes are unlikely to serialize correctly due to implicit references to the outer class. Example: 'class A {\n class Main implements Serializable {\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes. Inspection ID: SerializableInnerClassWithNonSerializableOuterClass",
+ "markdown": "Reports non-static inner classes that implement `Serializable` and are declared inside a class that doesn't implement `Serializable`.\n\n\nSuch classes are unlikely to serialize correctly due to implicit references to the outer class.\n\n**Example:**\n\n\n class A {\n class Main implements Serializable {\n }\n }\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes.\n\nInspection ID: SerializableInnerClassWithNonSerializableOuterClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableInnerClassWithNonSerializableOuterClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousListRemoveInLoop",
+ "shortDescription": {
+ "text": "Suspicious 'List.remove()' in loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'list.remove(index)' calls inside an ascending counted loop. This is suspicious as the list becomes shorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable after the removal, but probably removing via an iterator or using the 'removeIf()' method (Java 8 and later) is a more robust alternative. If you don't expect that 'remove()' will be called more than once in a loop, consider adding a 'break' after it. Example: 'public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }' The code looks like '1 2 3 4' is going to be printed, but in reality, '3' will be skipped in the output. Inspection ID: SuspiciousListRemoveInLoop New in 2018.2",
+ "markdown": "Reports `list.remove(index)` calls inside an ascending counted loop.\n\n\nThis is suspicious as the list becomes\nshorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable\nafter the removal,\nbut probably removing via an iterator or using the `removeIf()` method (Java 8 and later) is a more robust alternative.\nIf you don't expect that `remove()` will be called more than once in a loop, consider adding a `break` after it.\n\n**Example:**\n\n public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }\n\nThe code looks like `1 2 3 4` is going to be printed, but in reality, `3` will be skipped in the output.\n\nInspection ID: SuspiciousListRemoveInLoop\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousListRemoveInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NegativeIntConstantInLongContext",
+ "shortDescription": {
+ "text": "Negative int hexadecimal constant in long context"
+ },
+ "fullDescription": {
+ "text": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing. Example: '// Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;' Inspection ID: NegativeIntConstantInLongContext New in 2022.3",
+ "markdown": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing.\n\n**Example:**\n\n\n // Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;\n\nInspection ID: NegativeIntConstantInLongContext\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NegativeIntConstantInLongContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DefaultAnnotationParam",
+ "shortDescription": {
+ "text": "Default annotation parameter value"
+ },
+ "fullDescription": {
+ "text": "Reports annotation parameters that are assigned to their 'default' value. Example: '@interface Test {\n Class> expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}' After the quick-fix is applied: '@Test()\n void testSmth() {}' Inspection ID: DefaultAnnotationParam",
+ "markdown": "Reports annotation parameters that are assigned to their `default` value.\n\nExample:\n\n\n @interface Test {\n Class> expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}\n\nAfter the quick-fix is applied:\n\n\n @Test()\n void testSmth() {}\n\nInspection ID: DefaultAnnotationParam"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DefaultAnnotationParam",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WhileLoopSpinsOnField",
+ "shortDescription": {
+ "text": "'while' loop spins on field"
+ },
+ "fullDescription": {
+ "text": "Reports 'while' loops that spin on the value of a non-'volatile' field, waiting for it to be changed by another thread. In addition to being potentially extremely CPU intensive when little work is done inside the loop, such loops are likely to have different semantics from what was intended. The Java Memory Model allows such loops to never complete even if another thread changes the field's value. Additionally, since Java 9 it's recommended to call 'Thread.onSpinWait()' inside a spin loop on a 'volatile' field, which may significantly improve performance on some hardware. Example: 'class SpinsOnField {\n boolean ready = false;\n\n void run() {\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' After the quick-fix is applied: 'class SpinsOnField {\n volatile boolean ready = false;\n\n void run() {\n while (!ready) {\n Thread.onSpinWait();\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' Use the inspection options to only report empty 'while' loops. Inspection ID: WhileLoopSpinsOnField",
+ "markdown": "Reports `while` loops that spin on the value of a non-`volatile` field, waiting for it to be changed by another thread.\n\n\nIn addition to being potentially extremely CPU intensive when little work is done inside the loop, such\nloops are likely to have different semantics from what was intended.\nThe Java Memory Model allows such loops to never complete even if another thread changes the field's value.\n\n\nAdditionally, since Java 9 it's recommended to call `Thread.onSpinWait()` inside a spin loop\non a `volatile` field, which may significantly improve performance on some hardware.\n\n**Example:**\n\n\n class SpinsOnField {\n boolean ready = false;\n\n void run() {\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class SpinsOnField {\n volatile boolean ready = false;\n\n void run() {\n while (!ready) {\n Thread.onSpinWait();\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\n\nUse the inspection options to only report empty `while` loops.\n\n\nInspection ID: WhileLoopSpinsOnField"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WhileLoopSpinsOnField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizeOnLock",
+ "shortDescription": {
+ "text": "Synchronization on a 'Lock' object"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' blocks that lock on an instance of 'java.util.concurrent.locks.Lock'. Such synchronization is almost certainly unintended, and appropriate versions of '.lock()' and '.unlock()' should be used instead. Example: 'final ReentrantLock lock = new ReentrantLock();\n\n public void foo() {\n synchronized (lock) {}\n }' Inspection ID: SynchronizeOnLock",
+ "markdown": "Reports `synchronized` blocks that lock on an instance of `java.util.concurrent.locks.Lock`. Such synchronization is almost certainly unintended, and appropriate versions of `.lock()` and `.unlock()` should be used instead.\n\n**Example:**\n\n\n final ReentrantLock lock = new ReentrantLock();\n\n public void foo() {\n synchronized (lock) {}\n }\n\nInspection ID: SynchronizeOnLock"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchroniziationOnLockObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BadExceptionCaught",
+ "shortDescription": {
+ "text": "Prohibited 'Exception' caught"
+ },
+ "fullDescription": {
+ "text": "Reports 'catch' clauses that catch an inappropriate exception. Some exceptions, for example 'java.lang.NullPointerException' or 'java.lang.IllegalMonitorStateException', represent programming errors and therefore almost certainly should not be caught in production code. Example: 'try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }' Use the Prohibited exceptions list to specify which exceptions should be reported. Inspection ID: BadExceptionCaught",
+ "markdown": "Reports `catch` clauses that catch an inappropriate exception.\n\nSome exceptions, for example\n`java.lang.NullPointerException` or\n`java.lang.IllegalMonitorStateException`, represent programming errors\nand therefore almost certainly should not be caught in production code.\n\n**Example:**\n\n\n try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported.\n\n\nInspection ID: BadExceptionCaught"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProhibitedExceptionCaught",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceofCatchParameter",
+ "shortDescription": {
+ "text": "'instanceof' on 'catch' parameter"
+ },
+ "fullDescription": {
+ "text": "Reports cases in which an 'instanceof' expression is used for testing the type of a parameter in a 'catch' block. Testing the type of 'catch' parameters is usually better done by having separate 'catch' blocks instead of using 'instanceof'. Example: 'void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }' Inspection ID: InstanceofCatchParameter",
+ "markdown": "Reports cases in which an `instanceof` expression is used for testing the type of a parameter in a `catch` block.\n\nTesting the type of `catch` parameters is usually better done by having separate\n`catch` blocks instead of using `instanceof`.\n\n**Example:**\n\n\n void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }\n\nInspection ID: InstanceofCatchParameter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceofCatchParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantScheduledForRemovalAnnotation",
+ "shortDescription": {
+ "text": "Redundant @ScheduledForRemoval annotation"
+ },
+ "fullDescription": {
+ "text": "Reports usages of '@ApiStatus.ScheduledForRemoval' annotation without 'inVersion' attribute in code which targets Java 9 or newer version. Such usages can be replaced by 'forRemoval' attribute in '@Deprecated' annotation to simplify code. Inspection ID: RedundantScheduledForRemovalAnnotation New in 2022.1",
+ "markdown": "Reports usages of `@ApiStatus.ScheduledForRemoval` annotation without `inVersion` attribute in code which targets Java 9 or newer version.\n\n\nSuch usages can be replaced by `forRemoval` attribute in `@Deprecated` annotation to simplify code.\n\nInspection ID: RedundantScheduledForRemovalAnnotation\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantScheduledForRemovalAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 58,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalGetWithoutIsPresent",
+ "shortDescription": {
+ "text": "Optional.get() is called without isPresent() check"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'get()' on an 'Optional' without checking that it has a value. Calling 'Optional.get()' on an empty 'Optional' instance will throw an exception. Example: 'void x(List list) {\n final Optional optional =\n list.stream().filter(x -> x > 10).findFirst();\n final Integer result = optional.get(); // problem here\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalGetWithoutIsPresent",
+ "markdown": "Reports calls to `get()` on an `Optional` without checking that it has a value.\n\nCalling `Optional.get()` on an empty `Optional` instance will throw an exception.\n\n**Example:**\n\n\n void x(List list) {\n final Optional optional =\n list.stream().filter(x -> x > 10).findFirst();\n final Integer result = optional.get(); // problem here\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalGetWithoutIsPresent"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalGetWithoutIsPresent",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OnDemandImport",
+ "shortDescription": {
+ "text": "'*' import"
+ },
+ "fullDescription": {
+ "text": "Reports any 'import' statements that cover entire packages ('* imports'). Some coding standards prohibit such 'import' statements. You can configure IntelliJ IDEA to detect and fix such statements with its Optimize Imports command. Go to Settings | Editor | Code Style | Java | Imports, make sure that the Use single class import option is enabled, and specify values in the Class count to use import with '*' and Names count to use static import with '*' fields. Thus this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: OnDemandImport",
+ "markdown": "Reports any `import` statements that cover entire packages ('\\* imports').\n\nSome coding standards prohibit such `import` statements.\n\n\nYou can configure IntelliJ IDEA to detect and fix such statements with its **Optimize Imports**\ncommand. Go to [Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?Use%20single%20class%20import),\nmake sure that the **Use single class import** option is enabled, and specify values in the\n**Class count to use import with '\\*'** and **Names count to use static import with '\\*'** fields.\nThus this inspection is mostly useful for offline reporting on code bases that you don't\nintend to change.\n\nInspection ID: OnDemandImport"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OnDemandImport",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FallthruInSwitchStatement",
+ "shortDescription": {
+ "text": "Fallthrough in 'switch' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'fall-through' in a 'switch' statement. Fall-through occurs when a series of executable statements after a 'case' label is not guaranteed to transfer control before the next 'case' label. For example, this can happen if the branch is missing a 'break' statement. In that case, control falls through to the statements after that 'switch' label, even though the 'switch' expression is not equal to the value of the fallen-through label. While occasionally intended, this construction is confusing and is often the result of a typo. This inspection ignores any fall-through commented with a text matching the regex pattern '(?i)falls?\\s*thro?u'. There is a fix that adds a 'break' to the branch that can fall through to the next branch. Example: 'switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n // no break here\n } else {\n break;\n }\n case (6):\n System.out.println(\"4\");\n }' After the quick-fix is applied: 'switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n } else {\n break;\n }\n break;\n case (6):\n System.out.println(\"4\");\n }' Inspection ID: FallthruInSwitchStatement",
+ "markdown": "Reports 'fall-through' in a `switch` statement.\n\nFall-through occurs when a series of executable statements after a `case` label is not guaranteed\nto transfer control before the next `case` label. For example, this can happen if the branch is missing a `break` statement.\nIn that case, control falls through to the statements after\nthat `switch` label, even though the `switch` expression is not equal to\nthe value of the fallen-through label. While occasionally intended, this construction is confusing and is often the result of a typo.\n\n\nThis inspection ignores any fall-through commented with a text matching the regex pattern `(?i)falls?\\s*thro?u`.\n\nThere is a fix that adds a `break` to the branch that can fall through to the next branch.\n\nExample:\n\n\n switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n // no break here\n } else {\n break;\n }\n case (6):\n System.out.println(\"4\");\n }\n\nAfter the quick-fix is applied:\n\n\n switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n } else {\n break;\n }\n break;\n case (6):\n System.out.println(\"4\");\n }\n\n\nInspection ID: FallthruInSwitchStatement"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "fallthrough",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalIsPresent",
+ "shortDescription": {
+ "text": "Non functional style 'Optional.isPresent()' usage"
+ },
+ "fullDescription": {
+ "text": "Reports 'Optional' expressions used as 'if' or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read. Example: 'if (str.isPresent()) str.get().trim();' After the quick-fix is applied: 'str.ifPresent(String::trim);' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalIsPresent",
+ "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalIsPresent"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalIsPresent",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantOperationOnEmptyContainer",
+ "shortDescription": {
+ "text": "Redundant operation on empty container"
+ },
+ "fullDescription": {
+ "text": "Reports redundant operations on empty collections, maps or arrays. Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug. Example: 'if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }' Inspection ID: RedundantOperationOnEmptyContainer New in 2019.1",
+ "markdown": "Reports redundant operations on empty collections, maps or arrays.\n\n\nIterating, removing elements, sorting,\nand some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.\n\n**Example:**\n\n\n if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }\n\nInspection ID: RedundantOperationOnEmptyContainer\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantOperationOnEmptyContainer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AtomicFieldUpdaterNotStaticFinal",
+ "shortDescription": {
+ "text": "'AtomicFieldUpdater' field not declared 'static final'"
+ },
+ "fullDescription": {
+ "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' Inspection ID: AtomicFieldUpdaterNotStaticFinal",
+ "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nInspection ID: AtomicFieldUpdaterNotStaticFinal"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AtomicFieldUpdaterNotStaticFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java8MapForEach",
+ "shortDescription": {
+ "text": "Map.forEach() can be used"
+ },
+ "fullDescription": {
+ "text": "Suggests replacing 'for(Entry,?> entry : map.entrySet()) {...}' or 'map.entrySet().forEach(entry -> ...)' with 'map.forEach((key, value) -> ...)'. Example 'void print(Map map) {\n map.entrySet().forEach(entry -> {\n String str = entry.getKey();\n System.out.println(str + \":\" + entry.getValue());\n });\n }' After the quick-fix is applied: 'void print(Map map) {\n map.forEach((str, value) -> System.out.println(str + \":\" + value));\n }' When the Do not report loops option is enabled, only 'entrySet().forEach()' cases will be reported. However, the quick-fix action will be available for 'for'-loops as well. This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8MapForEach New in 2017.1",
+ "markdown": "Suggests replacing `for(Entry,?> entry : map.entrySet()) {...}` or `map.entrySet().forEach(entry -> ...)` with `map.forEach((key, value) -> ...)`.\n\nExample\n\n\n void print(Map map) {\n map.entrySet().forEach(entry -> {\n String str = entry.getKey();\n System.out.println(str + \":\" + entry.getValue());\n });\n }\n\nAfter the quick-fix is applied:\n\n\n void print(Map map) {\n map.forEach((str, value) -> System.out.println(str + \":\" + value));\n }\n\n\nWhen the **Do not report loops** option is enabled, only `entrySet().forEach()` cases will be reported.\nHowever, the quick-fix action will be available for `for`-loops as well.\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8MapForEach\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java8MapForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RecordStoreResource",
+ "shortDescription": {
+ "text": "'RecordStore' opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }' Inspection ID: RecordStoreResource",
+ "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n\nInspection ID: RecordStoreResource"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RecordStoreOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 181,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectsEqualsCanBeSimplified",
+ "shortDescription": {
+ "text": "'Objects.equals()' can be replaced with 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Objects.equals(a, b)' in which the first argument is statically known to be non-null. Such a call can be safely replaced with 'a.equals(b)' or 'a == b' if both arguments are primitives. Example: 'String defaultName = \"default\";\n boolean isDefault = Objects.equals(defaultName, name);' After the quick-fix is applied: 'String defaultName = \"default\";\n boolean isDefault = defaultName.equals(name);' This inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7. Inspection ID: ObjectsEqualsCanBeSimplified New in 2018.3",
+ "markdown": "Reports calls to `Objects.equals(a, b)` in which the first argument is statically known to be non-null.\n\nSuch a call can be safely replaced with `a.equals(b)` or `a == b` if both arguments are primitives.\n\nExample:\n\n\n String defaultName = \"default\";\n boolean isDefault = Objects.equals(defaultName, name);\n\nAfter the quick-fix is applied:\n\n\n String defaultName = \"default\";\n boolean isDefault = defaultName.equals(name);\n\nThis inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7.\n\nInspection ID: ObjectsEqualsCanBeSimplified\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ObjectsEqualsCanBeSimplified",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Code Style"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassLoaderInstantiation",
+ "shortDescription": {
+ "text": "'ClassLoader' instantiation"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of the 'java.lang.ClassLoader' class. While often benign, any instantiations of 'ClassLoader' should be closely examined in any security audit. Example: 'Class> loadExtraClass(String name) throws Exception {\n try(URLClassLoader loader =\n new URLClassLoader(new URL[]{new URL(\"extraClasses/\")})) {\n return loader.loadClass(name);\n }\n }'\n Inspection ID: ClassLoaderInstantiation",
+ "markdown": "Reports instantiations of the `java.lang.ClassLoader` class.\n\nWhile often benign, any instantiations of `ClassLoader` should be closely examined in any security audit.\n\n**Example:**\n\n Class> loadExtraClass(String name) throws Exception {\n try(URLClassLoader loader =\n new URLClassLoader(new URL[]{new URL(\"extraClasses/\")})) {\n return loader.loadClass(name);\n }\n }\n \nInspection ID: ClassLoaderInstantiation"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassLoaderInstantiation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NativeMethods",
+ "shortDescription": {
+ "text": "Native method"
+ },
+ "fullDescription": {
+ "text": "Reports methods declared 'native'. Native methods are inherently unportable. Inspection ID: NativeMethods",
+ "markdown": "Reports methods declared `native`. Native methods are inherently unportable.\n\nInspection ID: NativeMethods"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NativeMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 93,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsWithItself",
+ "shortDescription": {
+ "text": "'equals()' called on itself"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'equals()', 'compareTo()' or similar, that compare an object for equality with itself. The method contracts of these methods specify that such calls will always return 'true' for 'equals()' or '0' for 'compareTo()'. The inspection also checks calls to 'Objects.equals()', 'Objects.deepEquals()', 'Arrays.equals()', 'Comparator.compare()', 'assertEquals()' methods of test frameworks (JUnit, TestNG, AssertJ), 'Integer.compare()', 'Integer.compareUnsigned()' and similar methods. Note that in rare cases, the inspection may report 'equals()' calls that return false, because while the expressions on the both sides are the same, they produce separate objects, and comparison is performed on references, rather than on content. The simplest example is 'new Object().equals(new Object())'. In any case, such calls are suspicious, and likely something else was intended. Example: 'class Foo {\n boolean foo(Object o) {\n return o.equals(o); // warning\n }\n\n boolean bar(String[] ss) {\n return Arrays.equals(ss, ss); // warning\n }\n}' Inspection ID: EqualsWithItself",
+ "markdown": "Reports calls to `equals()`, `compareTo()` or similar, that compare an object for equality with itself. The method contracts of these methods specify that such calls will always return `true` for `equals()` or `0` for `compareTo()`. The inspection also checks calls to `Objects.equals()`, `Objects.deepEquals()`, `Arrays.equals()`, `Comparator.compare()`, `assertEquals()` methods of test frameworks (JUnit, TestNG, AssertJ), `Integer.compare()`, `Integer.compareUnsigned()` and similar methods.\n\n\nNote that in rare cases, the inspection may report `equals()` calls that return false, because while the expressions\non the both sides are the same, they produce separate objects, and comparison is performed on references, rather than on content.\nThe simplest example is `new Object().equals(new Object())`. In any case, such calls are suspicious, and likely\nsomething else was intended.\n\n**Example:**\n\n\n class Foo {\n boolean foo(Object o) {\n return o.equals(o); // warning\n }\n\n boolean bar(String[] ss) {\n return Arrays.equals(ss, ss); // warning\n }\n }\n\nInspection ID: EqualsWithItself"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsWithItself",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassInheritanceDepth",
+ "shortDescription": {
+ "text": "Class too deep in inheritance tree"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are too deep in the inheritance hierarchy. Classes that are too deeply inherited may be confusing and indicate that a refactoring is necessary. All superclasses from a library are treated as a single superclass, libraries are considered unmodifiable. Use the Inheritance depth limit field to specify the maximum inheritance depth for a class. Inspection ID: ClassInheritanceDepth",
+ "markdown": "Reports classes that are too deep in the inheritance hierarchy.\n\nClasses that are too deeply inherited may be confusing and indicate that a refactoring is necessary.\n\nAll superclasses from a library are treated as a single superclass, libraries are considered unmodifiable.\n\nUse the **Inheritance depth limit** field to specify the maximum inheritance depth for a class.\n\nInspection ID: ClassInheritanceDepth"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassTooDeepInInheritanceTree",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 127,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MarkedForRemoval",
+ "shortDescription": {
+ "text": "Usage of API marked for removal"
+ },
+ "fullDescription": {
+ "text": "Reports usages of deprecated APIs (classes, fields, and methods) that are marked for removal with '@Deprecated(forRemoval=true)'. The code that uses an API marked for removal may cause a runtime error with a future version of the API. That is why the recommended severity for this inspection is Error. You can change the severity to Warning if you want to use the same code highlighting as in ordinary deprecation. Inspection ID: MarkedForRemoval New in 2017.3",
+ "markdown": "Reports usages of deprecated APIs (classes, fields, and methods) that are marked for removal with `@Deprecated(`**forRemoval**`=true)`.\n\n\nThe code that uses an API marked for removal may cause a runtime error with a future version of the API. That is why\nthe recommended severity for this inspection is *Error*.\n\n\nYou can change the severity to *Warning* if you want to use the same code highlighting as in ordinary deprecation.\n\nInspection ID: MarkedForRemoval\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "removal",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 58,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedConditionalExpression",
+ "shortDescription": {
+ "text": "Nested conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports nested conditional expressions as they may result in extremely confusing code. Example: 'int y = a == 10 ? b == 20 ? 10 : a : b;' Inspection ID: NestedConditionalExpression",
+ "markdown": "Reports nested conditional expressions as they may result in extremely confusing code.\n\nExample:\n\n\n int y = a == 10 ? b == 20 ? 10 : a : b;\n\n\nInspection ID: NestedConditionalExpression"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedConditionalExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BulkFileAttributesRead",
+ "shortDescription": {
+ "text": "Bulk 'Files.readAttributes()' call can be used"
+ },
+ "fullDescription": {
+ "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. Inspection ID: BulkFileAttributesRead New in 2022.1",
+ "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nInspection ID: BulkFileAttributesRead\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BulkFileAttributesRead",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WhileCanBeForeach",
+ "shortDescription": {
+ "text": "'while' loop can be replaced with enhanced 'for' loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection depends on the Java feature 'For-each loops', which is available since Java 5. Inspection ID: WhileCanBeForeach",
+ "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection depends on the Java feature 'For-each loops', which is available since Java 5.\n\nInspection ID: WhileCanBeForeach"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WhileLoopReplaceableByForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ImplicitNumericConversion",
+ "shortDescription": {
+ "text": "Implicit numeric conversion"
+ },
+ "fullDescription": {
+ "text": "Reports implicit conversion between numeric types. Implicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs. Example: 'double m(int i) {\n return i * 10;\n }' After the quick-fix is applied: 'double m(int i) {\n return (double) (i * 10);\n }' Configure the inspection: Use the Ignore widening conversions option to ignore implicit conversion that cannot result in data loss (for example, 'int'->'long'). Use the Ignore conversions from and to 'char' option to ignore conversion from and to 'char'. The inspection will still report conversion from and to floating-point numbers. Use the Ignore conversion from constants and literals to make the inspection ignore conversion from literals and compile-time constants. Inspection ID: ImplicitNumericConversion",
+ "markdown": "Reports implicit conversion between numeric types.\n\nImplicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.\n\n**Example:**\n\n\n double m(int i) {\n return i * 10;\n }\n\nAfter the quick-fix is applied:\n\n\n double m(int i) {\n return (double) (i * 10);\n }\n\nConfigure the inspection:\n\n* Use the **Ignore widening conversions** option to ignore implicit conversion that cannot result in data loss (for example, `int`-\\>`long`).\n* Use the **Ignore conversions from and to 'char'** option to ignore conversion from and to `char`. The inspection will still report conversion from and to floating-point numbers.\n* Use the **Ignore conversion from constants and literals** to make the inspection ignore conversion from literals and compile-time constants.\n\nInspection ID: ImplicitNumericConversion"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ImplicitNumericConversion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NotNullFieldNotInitialized",
+ "shortDescription": {
+ "text": "@NotNull field is not initialized"
+ },
+ "fullDescription": {
+ "text": "Reports fields annotated as not-null that are not initialized in the constructor. Example: 'public class MyClass {\n private @NotNull String value;\n\n public void setValue(@NotNull String value) {\n this.value = value;\n }\n\n public @NotNull String getValue() {\n return value;\n }\n}' Such fields may violate the not-null constraint. In the example above, the 'setValue' parameter is annotated as not-null, but 'getValue' may return null if the setter was not called. Inspection ID: NotNullFieldNotInitialized",
+ "markdown": "Reports fields annotated as not-null that are not initialized in the constructor.\n\nExample:\n\n public class MyClass {\n private @NotNull String value;\n\n public void setValue(@NotNull String value) {\n this.value = value;\n }\n\n public @NotNull String getValue() {\n return value;\n }\n }\n\n\nSuch fields may violate the not-null constraint. In the example above, the `setValue` parameter is annotated as not-null, but\n`getValue` may return null if the setter was not called.\n\nInspection ID: NotNullFieldNotInitialized"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NotNullFieldNotInitialized",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs/Nullability problems",
+ "index": 183,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverlyComplexBooleanExpression",
+ "shortDescription": {
+ "text": "Overly complex boolean expression"
+ },
+ "fullDescription": {
+ "text": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone. Example: 'cond(x1) && cond(x2) ^ cond(x3) && cond(x4);' Configure the inspection: Use the Maximum number of terms field to specify the maximum number of terms allowed in a boolean expression. Use the Ignore pure conjunctions and disjunctions option to ignore boolean expressions which use only a single boolean operator repeatedly. Inspection ID: OverlyComplexBooleanExpression",
+ "markdown": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone.\n\nExample:\n\n\n cond(x1) && cond(x2) ^ cond(x3) && cond(x4);\n\nConfigure the inspection:\n\n* Use the **Maximum number of terms** field to specify the maximum number of terms allowed in a boolean expression.\n* Use the **Ignore pure conjunctions and disjunctions** option to ignore boolean expressions which use only a single boolean operator repeatedly.\n\nInspection ID: OverlyComplexBooleanExpression"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexBooleanExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NotifyCalledOnCondition",
+ "shortDescription": {
+ "text": "'notify()' or 'notifyAll()' called on 'java.util.concurrent.locks.Condition' object"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'notify()' or 'notifyAll()' made on 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'signal()' or 'signalAll()' method was intended instead, otherwise 'IllegalMonitorStateException' may occur. Example: 'class C {\n final Lock l = new ReentrantLock();\n final Condition c = l.newCondition();\n\n void release() {\n l.lock();\n try {\n c.notifyAll(); // probably 'signalAll()' was intended here\n } finally {\n l.unlock();\n }\n }\n }' Inspection ID: NotifyCalledOnCondition",
+ "markdown": "Reports calls to `notify()` or `notifyAll()` made on `java.util.concurrent.locks.Condition` object.\n\n\nThis is probably a programming error, and some variant of the `signal()` or\n`signalAll()` method was intended instead, otherwise `IllegalMonitorStateException` may occur.\n\n**Example:**\n\n\n class C {\n final Lock l = new ReentrantLock();\n final Condition c = l.newCondition();\n\n void release() {\n l.lock();\n try {\n c.notifyAll(); // probably 'signalAll()' was intended here\n } finally {\n l.unlock();\n }\n }\n }\n\nInspection ID: NotifyCalledOnCondition"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NotifyCalledOnCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NewMethodNamingConvention",
+ "shortDescription": {
+ "text": "Method naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern. Instance methods that override library methods and constructors are ignored by this inspection. Example: if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default), the following static method produces a warning, because the length of its name is 3, which is less than 4: 'public static int max(int a, int b)'. A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the list in the Options section to specify which methods should be checked. Deselect the checkboxes for the method types for which you want to skip the check. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: NewMethodNamingConvention",
+ "markdown": "Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern.\n\nInstance methods that override library\nmethods and constructors are ignored by this inspection.\n\n**Example:** if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default),\nthe following static method produces a warning, because the length of its name is 3, which is less\nthan 4: `public static int max(int a, int b)`.\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which methods should be checked. Deselect the checkboxes for the method types for which\nyou want to skip the check. Specify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: NewMethodNamingConvention"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NewMethodNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 108,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverlyStrongTypeCast",
+ "shortDescription": {
+ "text": "Overly strong type cast"
+ },
+ "fullDescription": {
+ "text": "Reports type casts that are overly strong. For instance, casting an object to 'ArrayList' when casting it to 'List' would do just as well. Note: much like the Redundant type cast inspection, applying the fix for this inspection may change the semantics of your program if you are intentionally using an overly strong cast to cause a 'ClassCastException' to be generated. Example: 'interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }' Use the checkbox below to ignore casts when there's a matching 'instanceof' check in the code. Inspection ID: OverlyStrongTypeCast",
+ "markdown": "Reports type casts that are overly strong. For instance, casting an object to `ArrayList` when casting it to `List` would do just as well.\n\n\n**Note:** much like the *Redundant type cast*\ninspection, applying the fix for this inspection may change the semantics of your program if you are\nintentionally using an overly strong cast to cause a `ClassCastException` to be generated.\n\nExample:\n\n\n interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }\n\n\nUse the checkbox below to ignore casts when there's a matching `instanceof` check in the code.\n\nInspection ID: OverlyStrongTypeCast"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyStrongTypeCast",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 82,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaLangImport",
+ "shortDescription": {
+ "text": "Unnecessary import from the 'java.lang' package"
+ },
+ "fullDescription": {
+ "text": "Reports 'import' statements that refer to the 'java.lang' package. 'java.lang' classes are always implicitly imported, so such import statements are redundant and confusing. Since IntelliJ IDEA can automatically detect and fix such statements with its Optimize Imports command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: JavaLangImport",
+ "markdown": "Reports `import` statements that refer to the `java.lang` package.\n\n\n`java.lang` classes are always implicitly imported, so such import statements are\nredundant and confusing.\n\n\nSince IntelliJ IDEA can automatically detect and fix such statements with its **Optimize Imports** command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change.\n\nInspection ID: JavaLangImport"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaLangImport",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UtilityClass",
+ "shortDescription": {
+ "text": "Utility class"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes. Utility classes have all fields and methods declared as 'static' and their presence may indicate a lack of object-oriented design. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes annotated with one of these annotations. Inspection ID: UtilityClass",
+ "markdown": "Reports utility classes.\n\nUtility classes have all fields and methods declared as `static` and their\npresence may indicate a lack of object-oriented design.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes annotated with one of\nthese annotations.\n\n\nInspection ID: UtilityClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNameDiffersFromFileName",
+ "shortDescription": {
+ "text": "Class name differs from file name"
+ },
+ "fullDescription": {
+ "text": "Reports top-level class names that don't match the name of a file containing them. While the Java specification allows for naming non-'public' classes this way, files with unmatched names may be confusing and decrease usefulness of various software tools. Inspection ID: ClassNameDiffersFromFileName",
+ "markdown": "Reports top-level class names that don't match the name of a file containing them.\n\nWhile the Java specification allows for naming non-`public` classes this way,\nfiles with unmatched names may be confusing and decrease usefulness of various software tools.\n\nInspection ID: ClassNameDiffersFromFileName"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNameDiffersFromFileName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IndexOfReplaceableByContains",
+ "shortDescription": {
+ "text": "'String.indexOf()' expression can be replaced with 'contains()'"
+ },
+ "fullDescription": {
+ "text": "Reports comparisons with 'String.indexOf()' calls that can be replaced with a call to the 'String.contains()' method. Example: 'boolean b = \"abcd\".indexOf('e') >= 0;' After the quick-fix is applied: 'boolean b = \"abcd\".contains('e');' This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: IndexOfReplaceableByContains",
+ "markdown": "Reports comparisons with `String.indexOf()` calls that can be replaced with a call to the `String.contains()` method.\n\n**Example:**\n\n\n boolean b = \"abcd\".indexOf('e') >= 0;\n\nAfter the quick-fix is applied:\n\n\n boolean b = \"abcd\".contains('e');\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nInspection ID: IndexOfReplaceableByContains"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IndexOfReplaceableByContains",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationArgumentToLogCall",
+ "shortDescription": {
+ "text": "Non-constant string concatenation as argument to logging call"
+ },
+ "fullDescription": {
+ "text": "Reports non-constant string concatenations that are used as arguments to SLF4J and Log4j 2 logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled. Example: 'public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }' After the quick-fix is applied: 'public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }' Configure the inspection: Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated. Inspection ID: StringConcatenationArgumentToLogCall",
+ "markdown": "Reports non-constant string concatenations that are used as arguments to **SLF4J** and **Log4j 2** logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example:**\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated.\n\nInspection ID: StringConcatenationArgumentToLogCall"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "StringConcatenationArgumentToLogCall",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 120,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalContainsCollection",
+ "shortDescription": {
+ "text": "'Optional' contains array or collection"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.Optional' or 'com.google.common.base.Optional' types with an array or collection type parameter. In such cases, it is more clear to just use an empty array or collection to indicate the absence of result. Example: 'Optional> foo() {\n return Optional.empty();\n }' This code could look like: 'List foo() {\n return List.of();\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalContainsCollection",
+ "markdown": "Reports `java.util.Optional` or `com.google.common.base.Optional` types with an array or collection type parameter.\n\nIn such cases, it is more clear to just use an empty array or collection to indicate the absence of result.\n\n**Example:**\n\n\n Optional> foo() {\n return Optional.empty();\n }\n\nThis code could look like:\n\n\n List foo() {\n return List.of();\n }\n \nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalContainsCollection"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalContainsCollection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceMethodClashesWithObject",
+ "shortDescription": {
+ "text": "Interface method clashes with method in 'Object'"
+ },
+ "fullDescription": {
+ "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }' Inspection ID: InterfaceMethodClashesWithObject",
+ "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n\nInspection ID: InterfaceMethodClashesWithObject"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceMethodClashesWithObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 82,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableAssertion",
+ "shortDescription": {
+ "text": "Simplifiable assertion"
+ },
+ "fullDescription": {
+ "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();' Inspection ID: SimplifiableAssertion",
+ "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |\n\nInspection ID: SimplifiableAssertion"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableAssertion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 133,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoadLibraryWithNonConstantString",
+ "shortDescription": {
+ "text": "Call to 'System.loadLibrary()' with non-constant string"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();' Inspection ID: LoadLibraryWithNonConstantString",
+ "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n\nInspection ID: LoadLibraryWithNonConstantString"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoadLibraryWithNonConstantString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticMethodOnlyUsedInOneClass",
+ "shortDescription": {
+ "text": "Static member only used from one other class"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' methods and fields that are only used from a class other than the containing class. Such members could be moved into the using class. Factory methods and members accessed from an anonymous class inside the member's class are ignored by this inspection. Convenience overloads, which call a method with the same name in the same class but have fewer parameters, are also ignored. Use the first checkbox to suppress this inspection when the static member is only used from a test class. Use the second checkbox below to ignore member usages from inside anonymous, local, or non-static inner classes. Use the third checkbox below to not warn on members that cannot be moved without problems, for example, because a method with an identical signature is already present in the target class, or because a field or a method used inside the method will not be accessible when this method is moved. Use the fourth checkbox to ignore members located in utility classes. Inspection ID: StaticMethodOnlyUsedInOneClass",
+ "markdown": "Reports `static` methods and fields that are only used from a class other than the containing class. Such members could be moved into the using class. Factory methods and members accessed from an anonymous class inside the member's class are ignored by this inspection. Convenience overloads, which call a method with the same name in the same class but have fewer parameters, are also ignored.\n\n\nUse the first checkbox to suppress this inspection when the static member is only used from a test class.\n\n\nUse the second checkbox below to ignore member usages from inside anonymous, local, or non-static inner classes.\n\n\nUse the third checkbox below to not warn on members that cannot be moved without problems,\nfor example, because a method with an identical signature is already present in the target class,\nor because a field or a method used inside the method will not be accessible when this method is moved.\n\n\nUse the fourth checkbox to ignore members located in utility classes.\n\nInspection ID: StaticMethodOnlyUsedInOneClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticMethodOnlyUsedInOneClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 82,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantEscapeInRegexReplacement",
+ "shortDescription": {
+ "text": "Redundant escape in regex replacement string"
+ },
+ "fullDescription": {
+ "text": "Reports redundant escapes in the replacement string of regex methods. It is allowed to escape any character in a regex replacement string, but only for the '$' and '\\' characters is escaping necessary. Example: 'string.replaceAll(\"a\", \"\\\\b\");' After the quick-fix is applied: 'string.replaceAll(\"a\", \"b\");' New in 2022.3 Inspection ID: RedundantEscapeInRegexReplacement",
+ "markdown": "Reports redundant escapes in the replacement string of regex methods. It is allowed to escape any character in a regex replacement string, but only for the `$` and `\\` characters is escaping necessary.\n\n**Example:**\n\n\n string.replaceAll(\"a\", \"\\\\b\");\n\nAfter the quick-fix is applied:\n\n\n string.replaceAll(\"a\", \"b\");\n\nNew in 2022.3\n\nInspection ID: RedundantEscapeInRegexReplacement"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantEscapeInRegexReplacement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizedOnLiteralObject",
+ "shortDescription": {
+ "text": "Synchronization on an object initialized with a literal"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' blocks that lock on an object initialized with a literal. String literals are interned and 'Character', 'Boolean' and 'Number' literals can be allocated from a cache. Because of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually holding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private. Example: 'class Main {\n final String mutex = \"Mutex\";\n void method() {\n synchronized (mutex) {\n }\n }\n }' Use the Warn on all possible literals option to report any synchronization on 'String', 'Character', 'Boolean' and 'Number' objects. Inspection ID: SynchronizedOnLiteralObject",
+ "markdown": "Reports `synchronized` blocks that lock on an object initialized with a literal.\n\n\nString literals are interned and `Character`, `Boolean` and `Number` literals can be allocated from a cache.\nBecause of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually\nholding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private.\n\n**Example:**\n\n\n class Main {\n final String mutex = \"Mutex\";\n void method() {\n synchronized (mutex) {\n }\n }\n }\n\n\nUse the **Warn on all possible literals** option to report any synchronization on\n`String`, `Character`, `Boolean` and `Number` objects.\n\nInspection ID: SynchronizedOnLiteralObject"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizedOnLiteralObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9ReflectionClassVisibility",
+ "shortDescription": {
+ "text": "Reflective access across modules issues"
+ },
+ "fullDescription": {
+ "text": "Reports 'Class.forName()' and 'ClassLoader.loadClass()' calls which try to access classes that aren't visible in the current scope due to Java 9 module accessibility rules. This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: Java9ReflectionClassVisibility",
+ "markdown": "Reports `Class.forName()` and `ClassLoader.loadClass()` calls which try to access classes that aren't visible in the current scope due to Java 9 module accessibility rules.\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: Java9ReflectionClassVisibility"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9ReflectionClassVisibility",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Reflective access",
+ "index": 134,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CharsetObjectCanBeUsed",
+ "shortDescription": {
+ "text": "Standard 'Charset' object can be used"
+ },
+ "fullDescription": {
+ "text": "Reports methods and constructors in which constant charset 'String' literal (for example, '\"UTF-8\"') can be replaced with the predefined 'StandardCharsets.UTF_8' code. The code after the fix may work faster, because the charset lookup becomes unnecessary. Also, catching 'UnsupportedEncodingException' may become unnecessary as well. In this case, the catch block will be removed automatically. Example: 'try {\n byte[] bytes = \"str\".getBytes(\"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n }' After quick-fix is applied: 'byte[] bytes = \"str\".getBytes(StandardCharsets.UTF_8);' The inspection is available in Java 7 and later. Inspection ID: CharsetObjectCanBeUsed New in 2018.2",
+ "markdown": "Reports methods and constructors in which constant charset `String` literal (for example, `\"UTF-8\"`) can be replaced with the predefined `StandardCharsets.UTF_8` code.\n\nThe code after the fix may work faster, because the charset lookup becomes unnecessary.\nAlso, catching `UnsupportedEncodingException` may become unnecessary as well. In this case,\nthe catch block will be removed automatically.\n\nExample:\n\n\n try {\n byte[] bytes = \"str\".getBytes(\"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n }\n\nAfter quick-fix is applied:\n\n\n byte[] bytes = \"str\".getBytes(StandardCharsets.UTF_8);\n\nThe inspection is available in Java 7 and later.\n\nInspection ID: CharsetObjectCanBeUsed\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CharsetObjectCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfSunClasses",
+ "shortDescription": {
+ "text": "Use of 'sun.*' classes"
+ },
+ "fullDescription": {
+ "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs. Inspection ID: UseOfSunClasses",
+ "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs.\n\nInspection ID: UseOfSunClasses"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfSunClasses",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 93,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantCast",
+ "shortDescription": {
+ "text": "Redundant type cast"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary cast expressions. Example: 'static Object toObject(String s) {\n return (Object) s;\n }' After the quick-fix is applied: 'static Object toObject(String s) {\n return s;\n }' Use the checkbox below to ignore clarifying casts, for example casts in collection calls where 'Object' is expected: 'static void removeFromList(List l, Object o) {\n l.remove((String)o);\n }' Inspection ID: RedundantCast",
+ "markdown": "Reports unnecessary cast expressions.\n\n**Example:**\n\n\n static Object toObject(String s) {\n return (Object) s;\n }\n\nAfter the quick-fix is applied:\n\n\n static Object toObject(String s) {\n return s;\n }\n\n\nUse the checkbox below to ignore clarifying casts, for example casts in collection calls where `Object` is expected:\n\n\n static void removeFromList(List l, Object o) {\n l.remove((String)o);\n } \n\nInspection ID: RedundantCast"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantCast",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousInnerClass",
+ "shortDescription": {
+ "text": "Anonymous class can be replaced with inner class"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous classes. Occasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code. Some code standards discourage anonymous classes. Example: 'class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }' After the quick-fix is applied: 'class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }' Inspection ID: AnonymousInnerClass",
+ "markdown": "Reports anonymous classes.\n\nOccasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code.\nSome code standards discourage anonymous classes.\n\n**Example:**\n\n\n class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }\n\nInspection ID: AnonymousInnerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "AnonymousInnerClass",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifyCollector",
+ "shortDescription": {
+ "text": "Simplifiable collector"
+ },
+ "fullDescription": {
+ "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: SimplifyCollector New in 2017.1",
+ "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: SimplifyCollector\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifyCollector",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultipleTopLevelClassesInFile",
+ "shortDescription": {
+ "text": "Multiple top level classes in single file"
+ },
+ "fullDescription": {
+ "text": "Reports multiple top-level classes in a single Java file. Putting multiple top-level classes in one file may be confusing and degrade the usefulness of various software tools. Inspection ID: MultipleTopLevelClassesInFile",
+ "markdown": "Reports multiple top-level classes in a single Java file.\n\nPutting multiple\ntop-level classes in one file may be confusing and degrade the usefulness of various\nsoftware tools.\n\nInspection ID: MultipleTopLevelClassesInFile"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MultipleTopLevelClassesInFile",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IteratorNextDoesNotThrowNoSuchElementException",
+ "shortDescription": {
+ "text": "'Iterator.next()' which can't throw 'NoSuchElementException'"
+ },
+ "fullDescription": {
+ "text": "Reports implementations of 'Iterator.next()' that cannot throw 'java.util.NoSuchElementException'. Such implementations violate the contract of 'java.util.Iterator', and may result in subtle bugs if the iterator is used in a non-standard way. Example: 'class Numbers implements Iterator {\n @Override\n public Integer next() { //warning\n if (hasNext()) {\n return generateNext();\n } else {\n return null; //throw NoSuchElementException instead\n }\n }\n\n ...\n }' Inspection ID: IteratorNextDoesNotThrowNoSuchElementException",
+ "markdown": "Reports implementations of `Iterator.next()` that cannot throw `java.util.NoSuchElementException`.\n\n\nSuch implementations violate the contract of `java.util.Iterator`,\nand may result in subtle bugs if the iterator is used in a non-standard way.\n\n**Example:**\n\n\n class Numbers implements Iterator {\n @Override\n public Integer next() { //warning\n if (hasNext()) {\n return generateNext();\n } else {\n return null; //throw NoSuchElementException instead\n }\n }\n\n ...\n }\n\nInspection ID: IteratorNextDoesNotThrowNoSuchElementException"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IteratorNextCanNotThrowNoSuchElementException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IncorrectMessageFormat",
+ "shortDescription": {
+ "text": "Incorrect 'MessageFormat' pattern"
+ },
+ "fullDescription": {
+ "text": "Reports incorrect message format patterns or incorrect indexes of placeholders The following errors are reported: Unparsed or negative index Unclosed brace Unpaired quote. In this case, a part of a pattern may not be used Probably incorrect number of quotes Incorrect lower bound of nested choice patterns Incorrect indexes of placeholders. In this case, a placeholder may not be substituted or an argument may not be used Examples: 'MessageFormat.format(\"{wrong}\", 1); // incorrect index\n MessageFormat.format(\"{0\", 1); // Unmatched brace\n MessageFormat.format(\"'{0}\", 1); // Unpaired quote\n MessageFormat.format(\"It''''s {0}\", 1); // \"It''s\" will be printed, instead of \"It's\"\n MessageFormat.format(\"{0}\", 1, 2); // The argument with index '1' is not used in the pattern' Use the Custom MessageFormat methods table to specify method calls that should have their arguments checked as MessageFormat patterns. The table contains pairs of fully qualified class name and method name regular expression to match the containing class and name of the method calls. Class names also match subclasses. New in 2023.2 Inspection ID: IncorrectMessageFormat",
+ "markdown": "Reports incorrect message format patterns or incorrect indexes of placeholders\n\nThe following errors are reported:\n\n* Unparsed or negative index\n* Unclosed brace\n* Unpaired quote. In this case, a part of a pattern may not be used\n* Probably incorrect number of quotes\n* Incorrect lower bound of nested choice patterns\n* Incorrect indexes of placeholders. In this case, a placeholder may not be substituted or an argument may not be used\n\nExamples:\n\n\n MessageFormat.format(\"{wrong}\", 1); // incorrect index\n MessageFormat.format(\"{0\", 1); // Unmatched brace\n MessageFormat.format(\"'{0}\", 1); // Unpaired quote\n MessageFormat.format(\"It''''s {0}\", 1); // \"It''s\" will be printed, instead of \"It's\"\n MessageFormat.format(\"{0}\", 1, 2); // The argument with index '1' is not used in the pattern\n\n\nUse the **Custom MessageFormat methods** table\nto specify method calls that should have their arguments checked as MessageFormat patterns.\nThe table contains pairs of fully qualified class name and method name regular expression\nto match the containing class and name of the method calls.\nClass names also match subclasses.\n\nNew in 2023.2\n\nInspection ID: IncorrectMessageFormat"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IncorrectMessageFormat",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousTernaryOperatorInVarargsCall",
+ "shortDescription": {
+ "text": "Suspicious ternary operator in varargs method call"
+ },
+ "fullDescription": {
+ "text": "Reports vararg method calls that use a ternary operator with mixed array and non-array branches. When compiled, both branches are wrapped in arrays. As a result, the array branch is turned into a two-dimensional array, which may indicate a problem. The quick-fix wraps the non-array branch in an array to prevent the compiler from doing the conversion. Example: 'static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : b);\n }\n static void foo(Object... obj) {\n }' After the quick-fix: 'static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : new Object[]{b});\n }\n static void foo(Object... obj) {\n }' This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: SuspiciousTernaryOperatorInVarargsCall New in 2020.3",
+ "markdown": "Reports vararg method calls that use a ternary operator with mixed array and non-array branches.\n\n\nWhen compiled, both branches are wrapped in arrays. As a result, the array branch is turned into\na two-dimensional array, which may indicate a problem.\n\n\nThe quick-fix wraps the non-array branch in an array to prevent the compiler from doing the conversion.\n\n**Example:**\n\n\n static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : b);\n }\n static void foo(Object... obj) {\n }\n\nAfter the quick-fix:\n\n\n static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : new Object[]{b});\n }\n static void foo(Object... obj) {\n }\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: SuspiciousTernaryOperatorInVarargsCall\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousTernaryOperatorInVarargsCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableInnerClassHasSerialVersionUIDField",
+ "shortDescription": {
+ "text": "Serializable non-static inner class without 'serialVersionUID'"
+ },
+ "fullDescription": {
+ "text": "Reports non-static inner classes that implement 'java.io.Serializable', but do not define a 'serialVersionUID' field. Without a 'serialVersionUID' field, any change to the class will make previously serialized versions unreadable. It is strongly recommended that 'Serializable' non-static inner classes have a 'serialVersionUID' field, otherwise the default serialization algorithm may result in serialized versions being incompatible between compilers due to differences in synthetic accessor methods. A quick-fix is suggested to add the missing 'serialVersionUID' field. Example: 'class Outer {\n class Inner implements Serializable {}\n }' After the quick-fix is applied: 'class Outer {\n class Inner implements Serializable {\n private static final long serialVersionUID = -7004458730436243902L;\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes. Inspection ID: SerializableInnerClassHasSerialVersionUIDField",
+ "markdown": "Reports non-static inner classes that implement `java.io.Serializable`, but do not define a `serialVersionUID` field.\n\n\nWithout a `serialVersionUID` field, any change to the class will make previously\nserialized versions unreadable. It is strongly recommended that `Serializable`\nnon-static inner classes have a `serialVersionUID` field, otherwise the default\nserialization algorithm may result in serialized versions being incompatible between\ncompilers due to differences in synthetic accessor methods.\n\n\nA quick-fix is suggested to add the missing `serialVersionUID` field.\n\n**Example:**\n\n\n class Outer {\n class Inner implements Serializable {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Outer {\n class Inner implements Serializable {\n private static final long serialVersionUID = -7004458730436243902L;\n }\n }\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes.\n\nInspection ID: SerializableInnerClassHasSerialVersionUIDField"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableNonStaticInnerClassWithoutSerialVersionUID",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterNameDiffersFromOverriddenParameter",
+ "shortDescription": {
+ "text": "Parameter name differs from parameter in overridden or overloaded method"
+ },
+ "fullDescription": {
+ "text": "Reports parameters whose names differ from the corresponding parameters of the methods they override or overload. While legal in Java, such inconsistent names may be confusing and decrease the documentation benefits of good naming practices. Example: 'class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String name) { super(name); }\n }' After the quick-fix is applied: 'class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String fullName) { super(fullName); }\n }' Use the options to indicate whether to ignore overridden parameter names that are only a single character long or come from a library method. Both can be useful if you do not wish to be bound by dubious naming conventions used in libraries. Inspection ID: ParameterNameDiffersFromOverriddenParameter",
+ "markdown": "Reports parameters whose names differ from the corresponding parameters of the methods they override or overload. While legal in Java, such inconsistent names may be confusing and decrease the documentation benefits of good naming practices.\n\n**Example:**\n\n\n class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String name) { super(name); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String fullName) { super(fullName); }\n }\n\n\nUse the options to indicate whether to ignore overridden parameter names that are only\na single character long or come from a library method. Both can be useful if\nyou do not wish to be bound by dubious naming conventions used in libraries.\n\nInspection ID: ParameterNameDiffersFromOverriddenParameter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterNameDiffersFromOverriddenParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OctalLiteral",
+ "shortDescription": {
+ "text": "Octal integer"
+ },
+ "fullDescription": {
+ "text": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals. Example: 'int i = 015;\n int j = 0_777;' This inspection has two different quick-fixes. After the Convert octal literal to decimal literal quick-fix is applied, the code changes to: 'int i = 13;\n int j = 511;' After the Remove leading zero to make decimal quick-fix is applied, the code changes to: 'int i = 15;\n int j = 777;' Inspection ID: OctalLiteral",
+ "markdown": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals.\n\nExample:\n\n\n int i = 015;\n int j = 0_777;\n\nThis inspection has two different quick-fixes.\nAfter the **Convert octal literal to decimal literal** quick-fix is applied, the code changes to:\n\n\n int i = 13;\n int j = 511;\n\nAfter the **Remove leading zero to make decimal** quick-fix is applied, the code changes to:\n\n\n int i = 15;\n int j = 777;\n\nInspection ID: OctalLiteral"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OctalInteger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadWriteStringCanBeUsed",
+ "shortDescription": {
+ "text": "'Files.readString()' or 'Files.writeString()' can be used"
+ },
+ "fullDescription": {
+ "text": "Reports method calls that read or write a 'String' as bytes using 'java.nio.file.Files'. Such calls can be replaced with a call to a 'Files.readString()' or 'Files.writeString()' method introduced in Java 11. Example: 'String s = \"example\";\n Files.write(Paths.get(\"out.txt\"), s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n s = new String(Files.readAllBytes(Paths.get(\"in.txt\")), StandardCharsets.ISO_8859_1);' After the quick fix is applied: 'String s = \"example\";\n Files.writeString(Paths.get(\"out.txt\"), s, StandardOpenOption.WRITE);\n s = Files.readString(Paths.get(\"in.txt\"), StandardCharsets.ISO_8859_1);' Note that the 'readString()' behavior differs from the 'new String(bytes, charset)' behavior when it comes to handling of invalid (unmappable) characters. The 'readString()' method throws an exception in such cases, while the 'new String(bytes, charset)' method silently replaces invalid characters with the replacement character. If silent replacement is desired, it would be better to suppress the inspection warning. Inspection ID: ReadWriteStringCanBeUsed New in 2018.3",
+ "markdown": "Reports method calls that read or write a `String` as bytes using `java.nio.file.Files`. Such calls can be replaced with a call to a `Files.readString()` or `Files.writeString()` method introduced in Java 11.\n\n**Example:**\n\n\n String s = \"example\";\n Files.write(Paths.get(\"out.txt\"), s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n s = new String(Files.readAllBytes(Paths.get(\"in.txt\")), StandardCharsets.ISO_8859_1);\n\nAfter the quick fix is applied:\n\n\n String s = \"example\";\n Files.writeString(Paths.get(\"out.txt\"), s, StandardOpenOption.WRITE);\n s = Files.readString(Paths.get(\"in.txt\"), StandardCharsets.ISO_8859_1);\n\n\nNote that the `readString()` behavior differs from the `new String(bytes, charset)` behavior when it comes to\nhandling of invalid (unmappable) characters. The `readString()` method throws an exception in such cases, while the\n`new String(bytes, charset)` method silently replaces invalid characters with the replacement character.\nIf silent replacement is desired, it would be better to suppress the inspection warning.\n\nInspection ID: ReadWriteStringCanBeUsed\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReadWriteStringCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 11",
+ "index": 189,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CyclomaticComplexity",
+ "shortDescription": {
+ "text": "Overly complex method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that have too many branch points. A branch point is one of the following: loop statement 'if' statement ternary expression 'catch' section expression with one or more '&&' or '||' operators inside 'switch' block with non-default branches Methods with too high cyclomatic complexity may be confusing and hard to test. Use the Method complexity limit field to specify the maximum allowed cyclomatic complexity for a method. Inspection ID: CyclomaticComplexity",
+ "markdown": "Reports methods that have too many branch points.\n\nA branch point is one of the following:\n\n* loop statement\n* `if` statement\n* ternary expression\n* `catch` section\n* expression with one or more `&&` or `||` operators inside\n* `switch` block with non-default branches\n\nMethods with too high cyclomatic complexity may be confusing and hard to test.\n\nUse the **Method complexity limit** field to specify the maximum allowed cyclomatic complexity for a method.\n\n\nInspection ID: CyclomaticComplexity"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 141,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AwaitNotInLoop",
+ "shortDescription": {
+ "text": "'await()' not called in loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.concurrent.locks.Condition.await()' not being called inside a loop. 'await()' and related methods are normally used to suspend a thread until some condition becomes true. As the thread could have been woken up for a different reason, the condition should be checked after the 'await()' call returns. A loop is a simple way to achieve this. Example: 'void acquire(Condition released) throws InterruptedException {\n released.await();\n }' Good code should look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }' Inspection ID: AwaitNotInLoop",
+ "markdown": "Reports `java.util.concurrent.locks.Condition.await()` not being called inside a loop.\n\n\n`await()` and related methods are normally used to suspend a thread until some condition becomes true.\nAs the thread could have been woken up for a different reason,\nthe condition should be checked after the `await()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n released.await();\n }\n\nGood code should look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n\nInspection ID: AwaitNotInLoop"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AwaitNotInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticVariableUninitializedUse",
+ "shortDescription": {
+ "text": "Static field used before initialization"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n public static int bar;\n\n public static void main(String[] args) {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report 'static' variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore primitive fields option to ignore uninitialized primitive fields. Inspection ID: StaticVariableUninitializedUse",
+ "markdown": "Reports `static` variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n public static int bar;\n\n public static void main(String[] args) {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report `static` variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields.\n\nInspection ID: StaticVariableUninitializedUse"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticVariableUsedBeforeInitialization",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CyclicClassDependency",
+ "shortDescription": {
+ "text": "Cyclic class dependency"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are mutually or cyclically dependent on other classes. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: CyclicClassDependency",
+ "markdown": "Reports classes that are mutually or cyclically dependent on other classes.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: CyclicClassDependency"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CyclicClassDependency",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 152,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringBufferReplaceableByStringBuilder",
+ "shortDescription": {
+ "text": "'StringBuffer' may be 'StringBuilder'"
+ },
+ "fullDescription": {
+ "text": "Reports variables declared as 'StringBuffer' and suggests replacing them with 'StringBuilder'. 'StringBuilder' is a non-thread-safe replacement for 'StringBuffer'. This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: StringBufferReplaceableByStringBuilder",
+ "markdown": "Reports variables declared as `StringBuffer` and suggests replacing them with `StringBuilder`. `StringBuilder` is a non-thread-safe replacement for `StringBuffer`.\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nInspection ID: StringBufferReplaceableByStringBuilder"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringBufferMayBeStringBuilder",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizedMethod",
+ "shortDescription": {
+ "text": "'synchronized' method"
+ },
+ "fullDescription": {
+ "text": "Reports the 'synchronized' modifier on methods. There are several reasons a 'synchronized' modifier on a method may be a bad idea: As little work as possible should be performed under a lock. Therefore it is often better to use a 'synchronized' block and keep there only the code that works with shared state. Synchronization becomes a part of a method's interface. This makes a transition to a different locking mechanism difficult. Keeping track of what is locking a particular object gets harder. The DoS (denial-of-service) attack becomes feasible either on purpose or unknowingly when inheriting the method's class. As an alternative, consider synchronizing on a 'private final' lock object, access to which can be completely controlled. A quick-fix is provided to wrap the method body with 'synchronized(this)'. Example: 'class Main {\n public synchronized void fooBar() {\n }\n }' After the quick-fix is applied: 'class Main {\n public void fooBar() {\n synchronized (this) {\n }\n }\n }' You can configure the following options for this inspection: Include native methods - include native methods into the inspection's scope. Ignore methods overriding a synchronized method - do not report methods that override a 'synchronized' method. Inspection ID: SynchronizedMethod",
+ "markdown": "Reports the `synchronized` modifier on methods.\n\n\nThere are several reasons a `synchronized` modifier on a method may be a bad idea:\n\n1. As little work as possible should be performed under a lock. Therefore it is often better to use a `synchronized` block and keep there only the code that works with shared state.\n2. Synchronization becomes a part of a method's interface. This makes a transition to a different locking mechanism difficult.\n3. Keeping track of what is locking a particular object gets harder.\n4. The DoS (denial-of-service) attack becomes feasible either on purpose or unknowingly when inheriting the method's class.\n\n\nAs an alternative, consider synchronizing on a `private final` lock object, access to which can be completely controlled.\n\nA quick-fix is provided to wrap the method body with `synchronized(this)`.\n\n**Example:**\n\n\n class Main {\n public synchronized void fooBar() {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public void fooBar() {\n synchronized (this) {\n }\n }\n }\n\nYou can configure the following options for this inspection:\n\n1. **Include native methods** - include native methods into the inspection's scope.\n2. **Ignore methods overriding a synchronized method** - do not report methods that override a `synchronized` method.\n\nInspection ID: SynchronizedMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizedMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractMethodWithMissingImplementations",
+ "shortDescription": {
+ "text": "Abstract method with missing implementations"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' methods that are not implemented in every concrete subclass. This results in a compile-time error on the subclasses; the inspection reports the problem at the point of the abstract method, allowing faster detection of the problem. Inspection ID: AbstractMethodWithMissingImplementations",
+ "markdown": "Reports `abstract` methods that are not implemented in every concrete subclass.\n\n\nThis results in a compile-time error on the subclasses;\nthe inspection reports the problem at the point of the abstract method, allowing faster detection of the problem.\n\nInspection ID: AbstractMethodWithMissingImplementations"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractMethodWithMissingImplementations",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Convert2MethodRef",
+ "shortDescription": {
+ "text": "Lambda can be replaced with method reference"
+ },
+ "fullDescription": {
+ "text": "Reports lambdas that can be replaced with method references. While often it could be a matter of taste, method references are more clear and readable compared to lambdas. Example: 'Runnable r = () -> System.out.println();' After the quick-fix is applied: 'Runnable r = System.out::println;' The inspection may suggest method references even if a lambda doesn't call any method, like replacing 'obj -> obj != null' with 'Objects::nonNull'. Use the Settings | Editor | Code Style | Java | Code Generation settings to configure special method references. This inspection depends on the following Java features: Lambda expressions Method references These features are available since Java 8. Inspection ID: Convert2MethodRef",
+ "markdown": "Reports lambdas that can be replaced with method references. While often it could be a matter of taste, method references are more clear and readable compared to lambdas.\n\nExample:\n\n\n Runnable r = () -> System.out.println();\n\nAfter the quick-fix is applied:\n\n\n Runnable r = System.out::println;\n\n\nThe inspection may suggest method references even if a lambda doesn't call any method, like replacing `obj -> obj != null`\nwith `Objects::nonNull`.\nUse the [Settings \\| Editor \\| Code Style \\| Java \\| Code Generation](settings://preferences.sourceCode.Java?Lambda%20Body)\nsettings to configure special method references.\n\nThis inspection depends on the following Java features:\n\n* Lambda expressions\n* Method references\n\nThese features are available since Java 8.\n\nInspection ID: Convert2MethodRef"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Convert2MethodRef",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryToStringCall",
+ "shortDescription": {
+ "text": "Unnecessary call to 'toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Removing redundant 'toString()' calls can occasionally even improve performance and reduce object allocations. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null. Removing the explicit 'toString()' in these cases will change the runtime semantics from throwing a 'NullPointException' to silently accepting the value when it is 'null'. Inspection ID: UnnecessaryToStringCall",
+ "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods,\nand the explicit call to `toString()` is not needed.\nRemoving redundant `toString()` calls can occasionally even improve performance and reduce object allocations.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null.\nRemoving the explicit `toString()` in these cases will change the runtime semantics\nfrom throwing a `NullPointException` to silently accepting the value when it is `null`.\n\nInspection ID: UnnecessaryToStringCall"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryToStringCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassOnlyUsedInOnePackage",
+ "shortDescription": {
+ "text": "Class only used from one other package"
+ },
+ "fullDescription": {
+ "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassOnlyUsedInOnePackage",
+ "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassOnlyUsedInOnePackage"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassOnlyUsedInOnePackage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Packaging issues",
+ "index": 47,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuppressionAnnotation",
+ "shortDescription": {
+ "text": "Inspection suppression annotation"
+ },
+ "fullDescription": {
+ "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\nstatic Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n}' Inspection ID: SuppressionAnnotation",
+ "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n\nInspection ID: SuppressionAnnotation"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuppressionAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Code Style"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizeOnNonFinalField",
+ "shortDescription": {
+ "text": "Synchronization on a non-final field"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }' Inspection ID: SynchronizeOnNonFinalField",
+ "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n\nInspection ID: SynchronizeOnNonFinalField"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizeOnNonFinalField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnSeparatedFromComputation",
+ "shortDescription": {
+ "text": "'return' separated from the result computation"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;' Inspection ID: ReturnSeparatedFromComputation",
+ "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n\nInspection ID: ReturnSeparatedFromComputation"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ReturnSeparatedFromComputation",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayObjectsEquals",
+ "shortDescription": {
+ "text": "Use of shallow or 'Objects' methods with arrays"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that seem to use an inappropriate method for determining array equality or calculating their hashcode. The following method calls are reported: 'Object.equals()' for any arrays 'Arrays.equals()' for multidimensional arrays 'Arrays.hashCode()' for multidimensional arrays Inspection ID: ArrayObjectsEquals",
+ "markdown": "Reports expressions that seem to use an inappropriate method for determining array equality or calculating their hashcode.\n\nThe following method calls are reported:\n\n* `Object.equals()` for any arrays\n* `Arrays.equals()` for multidimensional arrays\n* `Arrays.hashCode()` for multidimensional arrays\n\n\nInspection ID: ArrayObjectsEquals"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayObjectsEquals",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsWhichDoesntCheckParameterClass",
+ "shortDescription": {
+ "text": "'equals()' method that does not check the class of its parameter"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' methods that do not check the type of their parameter. Failure to check the type of the parameter in the 'equals()' method may result in latent errors if the object is used in an untyped collection. Example: 'class MyClass {\n int x;\n\n @Override\n public boolean equals(Object obj) {\n // equals method should return false if obj is not MyClass\n return ((MyClass)obj).x == x;\n }\n }' Inspection ID: EqualsWhichDoesntCheckParameterClass",
+ "markdown": "Reports `equals()` methods that do not check the type of their parameter.\n\nFailure to check the type of the parameter\nin the `equals()` method may result in latent errors if the object is used in an untyped collection.\n\n**Example:**\n\n\n class MyClass {\n int x;\n\n @Override\n public boolean equals(Object obj) {\n // equals method should return false if obj is not MyClass\n return ((MyClass)obj).x == x;\n }\n }\n\nInspection ID: EqualsWhichDoesntCheckParameterClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsDoesntCheckParameterClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseHashCodeMethodInspection",
+ "shortDescription": {
+ "text": "Standard 'hashCode()' method can be used"
+ },
+ "fullDescription": {
+ "text": "Reports bitwise operations that can be replaced with a call to the 'Long.hashCode()' or 'Double.hashCode()' methods. It detects the construct '(int)(x ^ (x >>> 32))' where 'x' is a variable of type 'long' or the result of a previous 'Double.doubleToLongBits()' call. The replacement shortens the code, improving its readability. Example: 'int result = (int)(var ^ (var >>> 32));' After applying the quick-fix: 'int result = Long.hashCode(var);' This inspection only reports if the language level of the project or module is 8 or higher. Inspection ID: UseHashCodeMethodInspection New in 2024.1",
+ "markdown": "Reports bitwise operations that can be replaced with a call to the `Long.hashCode()` or `Double.hashCode()` methods. It detects the construct `(int)(x ^ (x >>> 32))` where `x` is a variable of type `long` or the result of a previous `Double.doubleToLongBits()` call. The replacement shortens the code, improving its readability.\n\n**Example:**\n\n\n int result = (int)(var ^ (var >>> 32));\n\nAfter applying the quick-fix:\n\n\n int result = Long.hashCode(var);\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nInspection ID: UseHashCodeMethodInspection\n\nNew in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseHashCodeMethodInspection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousIndentAfterControlStatement",
+ "shortDescription": {
+ "text": "Suspicious indentation after control statement without braces"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious indentation of statements after a control statement without braces. Such indentation can make it look like the statement is inside the control statement, when in fact it will be executed unconditionally after the control statement. Example: 'class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }' Inspection ID: SuspiciousIndentAfterControlStatement",
+ "markdown": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n\nInspection ID: SuspiciousIndentAfterControlStatement"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousIndentAfterControlStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToSuperclassField",
+ "shortDescription": {
+ "text": "Constructor assigns value to field defined in superclass"
+ },
+ "fullDescription": {
+ "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }' Inspection ID: AssignmentToSuperclassField",
+ "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n\nInspection ID: AssignmentToSuperclassField"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToSuperclassField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 83,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NumericOverflow",
+ "shortDescription": {
+ "text": "Numeric overflow"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;' Inspection ID: NumericOverflow",
+ "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n\nInspection ID: NumericOverflow"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NumericOverflow",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNewInstance",
+ "shortDescription": {
+ "text": "Unsafe call to 'Class.newInstance()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.Class.newInstance()'. This method propagates exceptions thrown by the no-arguments constructor, including checked exceptions. Usages of this method effectively bypass the compile-time exception checking that would otherwise be performed by the compiler. A quick-fix is suggested to replace the call with a call to the 'java.lang.reflect.Constructor.newInstance()' method, which avoids this problem by wrapping any exception thrown by the constructor in a (checked) 'java.lang.reflect.InvocationTargetException'. Example: 'clazz.newInstance()' After the quick-fix is applied: 'clazz.getConstructor().newInstance();' Inspection ID: ClassNewInstance",
+ "markdown": "Reports calls to `java.lang.Class.newInstance()`.\n\n\nThis method propagates exceptions thrown by\nthe no-arguments constructor, including checked exceptions. Usages of this method\neffectively bypass the compile-time exception checking that would\notherwise be performed by the compiler.\n\n\nA quick-fix is suggested to replace the call with a call to the\n`java.lang.reflect.Constructor.newInstance()` method, which\navoids this problem by wrapping any exception thrown by the constructor in a\n(checked) `java.lang.reflect.InvocationTargetException`.\n\n**Example:**\n\n\n clazz.newInstance()\n\nAfter the quick-fix is applied:\n\n\n clazz.getConstructor().newInstance();\n\nInspection ID: ClassNewInstance"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNewInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LimitedScopeInnerClass",
+ "shortDescription": {
+ "text": "Local class"
+ },
+ "fullDescription": {
+ "text": "Reports local classes. A local class is a named nested class declared inside a code block. Local classes are uncommon and may therefore be confusing. In addition, some code standards discourage the use of local classes. Example: 'class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }' After the quick-fix is applied: 'class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }' Inspection ID: LimitedScopeInnerClass",
+ "markdown": "Reports local classes.\n\nA local class is a named nested class declared inside a code block.\nLocal classes are uncommon and may therefore be confusing.\nIn addition, some code standards discourage the use of local classes.\n\n**Example:**\n\n\n class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }\n\nInspection ID: LimitedScopeInnerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LimitedScopeInnerClass",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultiplyOrDivideByPowerOfTwo",
+ "shortDescription": {
+ "text": "Multiplication or division by power of two"
+ },
+ "fullDescription": {
+ "text": "Reports multiplication of an integer value by a constant integer that can be represented as a power of two. Such expressions can be replaced with right or left shift operations for a possible performance improvement. Note that this inspection is not relevant for modern JVMs (e. g., HotSpot or OpenJ9) because their JIT compilers will perform this optimization. It might only be useful in some embedded systems where no JIT compilation is performed. Example: 'int y = x * 4;' A quick-fix is suggested to replace the multiplication or division operation with the shift operation: 'int y = x << 2;' Use the option to make the inspection also report division by a power of two. Note that replacing a power of two division with a shift does not work for negative numbers. Inspection ID: MultiplyOrDivideByPowerOfTwo",
+ "markdown": "Reports multiplication of an integer value by a constant integer that can be represented as a power of two. Such expressions can be replaced with right or left shift operations for a possible performance improvement.\n\n\nNote that this inspection is not relevant for modern JVMs (e. g.,\nHotSpot or OpenJ9) because their JIT compilers will perform this optimization.\nIt might only be useful in some embedded systems where no JIT compilation is performed.\n\n**Example:**\n\n\n int y = x * 4;\n\nA quick-fix is suggested to replace the multiplication or division operation with the shift operation:\n\n\n int y = x << 2;\n\n\nUse the option to make the inspection also report division by a power of two.\nNote that replacing a power of two division with a shift does not work for negative numbers.\n\nInspection ID: MultiplyOrDivideByPowerOfTwo"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MultiplyOrDivideByPowerOfTwo",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 181,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCallInLoopCondition",
+ "shortDescription": {
+ "text": "Method call in loop condition"
+ },
+ "fullDescription": {
+ "text": "Reports method calls in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications. Applying the results of this inspection without consideration might have negative effects on code clarity and design. This inspection is intended for Java ME and other highly resource constrained environments. Example: 'String s = \"example\";\n for (int i = 0; i < s.length(); i++) {\n System.out.println(s.charAt(i));\n }' After the quick-fix is applied: 'String s = \"example\";\n int length = s.length();\n for (int i = 0; i < length; i++) {\n System.out.println(s.charAt(i));\n }' Use the option to ignore calls to common Java iteration methods like 'Iterator.hasNext()' and known methods with side-effects like 'Atomic*.compareAndSet'. Inspection ID: MethodCallInLoopCondition",
+ "markdown": "Reports method calls in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications.\n\n\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\nThis inspection is intended for Java ME and other highly resource constrained environments.\n\n**Example:**\n\n\n String s = \"example\";\n for (int i = 0; i < s.length(); i++) {\n System.out.println(s.charAt(i));\n }\n\nAfter the quick-fix is applied:\n\n\n String s = \"example\";\n int length = s.length();\n for (int i = 0; i < length; i++) {\n System.out.println(s.charAt(i));\n }\n\n\nUse the option to ignore calls to common Java iteration methods like `Iterator.hasNext()`\nand known methods with side-effects like `Atomic*.compareAndSet`.\n\nInspection ID: MethodCallInLoopCondition"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodCallInLoopCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 181,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCount",
+ "shortDescription": {
+ "text": "Class with too many methods"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose number of methods exceeds the specified maximum. Classes with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes. Configure the inspection: Use the Method count limit field to specify the maximum allowed number of methods in a class. Use the Ignore simple getter and setter methods option to ignore simple getters and setters in method count. Use the Ignore methods overriding/implementing a super method to ignore methods that override or implement a method from a superclass. Inspection ID: MethodCount",
+ "markdown": "Reports classes whose number of methods exceeds the specified maximum.\n\nClasses with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes.\n\nConfigure the inspection:\n\n* Use the **Method count limit** field to specify the maximum allowed number of methods in a class.\n* Use the **Ignore simple getter and setter methods** option to ignore simple getters and setters in method count.\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods that override or implement a method from a superclass.\n\nInspection ID: MethodCount"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyMethods",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 127,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForLoopReplaceableByWhile",
+ "shortDescription": {
+ "text": "'for' loop may be replaced by 'while' loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'for' loops that contain neither initialization nor update components, and suggests converting them to 'while' loops. This makes the code easier to read. Example: 'for(; exitCondition(); ) {\n process();\n }' After the quick-fix is applied: 'while(exitCondition()) {\n process();\n }' The quick-fix is also available for other 'for' loops, so you can replace any 'for' loop with a 'while' loop. Use the Ignore 'infinite' for loops without conditions option if you want to ignore 'for' loops with trivial or non-existent conditions. Inspection ID: ForLoopReplaceableByWhile",
+ "markdown": "Reports `for` loops that contain neither initialization nor update components, and suggests converting them to `while` loops. This makes the code easier to read.\n\nExample:\n\n\n for(; exitCondition(); ) {\n process();\n }\n\nAfter the quick-fix is applied:\n\n\n while(exitCondition()) {\n process();\n }\n\nThe quick-fix is also available for other `for` loops, so you can replace any `for` loop with a\n`while` loop.\n\nUse the **Ignore 'infinite' for loops without conditions** option if you want to ignore `for`\nloops with trivial or non-existent conditions.\n\n\nInspection ID: ForLoopReplaceableByWhile"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopReplaceableByWhile",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticFieldReferenceOnSubclass",
+ "shortDescription": {
+ "text": "Static field referenced via subclass"
+ },
+ "fullDescription": {
+ "text": "Reports accesses to static fields where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Child.foo);\n }' After the quick-fix is applied, the result looks like this: 'class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Parent.foo);\n }' Inspection ID: StaticFieldReferenceOnSubclass",
+ "markdown": "Reports accesses to static fields where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Child.foo);\n }\n\nAfter the quick-fix is applied, the result looks like this:\n\n\n class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Parent.foo);\n }\n\nInspection ID: StaticFieldReferenceOnSubclass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticFieldReferencedViaSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IgnoreResultOfCall",
+ "shortDescription": {
+ "text": "Result of method call ignored"
+ },
+ "fullDescription": {
+ "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors. Inspection ID: IgnoreResultOfCall",
+ "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.\n\n\nInspection ID: IgnoreResultOfCall"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ResultOfMethodCallIgnored",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BlockingMethodInNonBlockingContext",
+ "shortDescription": {
+ "text": "Possibly blocking call in non-blocking context"
+ },
+ "fullDescription": {
+ "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations Inspection ID: BlockingMethodInNonBlockingContext",
+ "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)\n\nInspection ID: BlockingMethodInNonBlockingContext"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BlockingMethodInNonBlockingContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Performance"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertBetweenInconvertibleTypes",
+ "shortDescription": {
+ "text": "'assertEquals()' between objects of inconvertible types"
+ },
+ "fullDescription": {
+ "text": "Reports calls to assertion methods where the \"expected\" and \"actual\" arguments are of incompatible types. Such calls often indicate that there is a bug in the test. This inspection checks the relevant JUnit, TestNG, and AssertJ methods. Examples: 'assertEquals(\"1\", 1);\n assertNotSame(new int[0], 0);\n\n // weak warning, may just test the equals() contract\n assertThat(foo).as(\"user type\").isNotEqualTo(bar);' Inspection ID: AssertBetweenInconvertibleTypes",
+ "markdown": "Reports calls to assertion methods where the \"expected\" and \"actual\" arguments are of incompatible types.\n\nSuch calls often indicate that there is a bug in the test.\nThis inspection checks the relevant JUnit, TestNG, and AssertJ methods.\n\n**Examples:**\n\n\n assertEquals(\"1\", 1);\n assertNotSame(new int[0], 0);\n\n // weak warning, may just test the equals() contract\n assertThat(foo).as(\"user type\").isNotEqualTo(bar);\n\nInspection ID: AssertBetweenInconvertibleTypes"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertBetweenInconvertibleTypes",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Reliability"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 125,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchExpressionCanBePushedDown",
+ "shortDescription": {
+ "text": "Common subexpression can be extracted from 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports switch expressions and statements where every branch has a common subexpression, and the 'switch' can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method. Example: 'switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }' After the quick-fix is applied: 'System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });' This inspection is applicable only for enhanced switches with arrow syntax. This inspection depends on the Java feature ''switch' expressions', which is available since Java 14. Inspection ID: SwitchExpressionCanBePushedDown New in 2022.3",
+ "markdown": "Reports switch expressions and statements where every branch has a common subexpression, and the `switch` can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method.\n\nExample:\n\n\n switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }\n\nAfter the quick-fix is applied:\n\n\n System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });\n\n\nThis inspection is applicable only for enhanced switches with arrow syntax.\n\nThis inspection depends on the Java feature ''switch' expressions', which is available since Java 14.\n\nInspection ID: SwitchExpressionCanBePushedDown\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SwitchExpressionCanBePushedDown",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassReferencedViaSubclass",
+ "shortDescription": {
+ "text": "Inner class referenced via subclass"
+ },
+ "fullDescription": {
+ "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }' Inspection ID: InnerClassReferencedViaSubclass",
+ "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n\nInspection ID: InnerClassReferencedViaSubclass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassReferencedViaSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConfusingElse",
+ "shortDescription": {
+ "text": "Redundant 'else'"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block. Inspection ID: ConfusingElse",
+ "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block.\n\nInspection ID: ConfusingElse"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ConfusingElseBranch",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads",
+ "shortDescription": {
+ "text": "'ScheduledThreadPoolExecutor' with zero core threads"
+ },
+ "fullDescription": {
+ "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }' Inspection ID: ScheduledThreadPoolExecutorWithZeroCoreThreads",
+ "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n\nInspection ID: ScheduledThreadPoolExecutorWithZeroCoreThreads"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ChannelResource",
+ "shortDescription": {
+ "text": "'Channel' opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: ChannelResource",
+ "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: ChannelResource"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ChannelOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 142,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaEmptyModuleInfoFile",
+ "shortDescription": {
+ "text": "Empty 'module-info.java' file"
+ },
+ "fullDescription": {
+ "text": "Reports an empty 'module-info.java' file, indicating unresolved module dependencies. Automatically adds necessary 'requires' statements by inspecting imports. To suppress this warning, you may write any comment inside the module statement body, like this: 'module module.name {\n // no dependencies\n}' Quick Fix: Fill in module dependencies fills in missing 'requires' based on source code imports. New in 2024.1 Inspection ID: JavaEmptyModuleInfoFile",
+ "markdown": "Reports an empty `module-info.java` file, indicating unresolved module dependencies. Automatically adds necessary `requires` statements by inspecting imports. To suppress this warning, you may write any comment inside the module statement body, like this:\n\n\n module module.name {\n // no dependencies\n }\n\n**Quick Fix:** *Fill in module dependencies* fills in missing `requires` based on source code imports. New in 2024.1\n\nInspection ID: JavaEmptyModuleInfoFile"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaEmptyModuleInfoFile",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassMayBeInterface",
+ "shortDescription": {
+ "text": "Abstract 'class' may be 'interface'"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' classes that can be converted to interfaces. Using interfaces instead of classes is preferable as Java doesn't support multiple class inheritance, while a class can implement multiple interfaces. A class may be converted to an interface if it has no superclasses (other than Object), has only 'public static final' fields, 'public abstract' methods, and 'public' inner classes. Example: 'abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n}\n\nclass Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n}' After the quick-fix is applied: 'interface Example {\n int MY_CONST = 42;\n void foo();\n}\n\nclass Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n}' Configure the inspection: Use the Report classes containing non-abstract methods when using Java 8 option to report only the classes with 'static' methods and non-abstract methods that can be converted to 'default' methods (only applicable to language level of 8 or higher). Inspection ID: ClassMayBeInterface",
+ "markdown": "Reports `abstract` classes that can be converted to interfaces.\n\nUsing interfaces instead of classes is preferable as Java doesn't support multiple class inheritance,\nwhile a class can implement multiple interfaces.\n\nA class may be converted to an interface if it has no superclasses (other\nthan Object), has only `public static final` fields,\n`public abstract` methods, and `public` inner classes.\n\n\nExample:\n\n\n abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n }\n\n class Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n interface Example {\n int MY_CONST = 42;\n void foo();\n }\n\n class Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Report classes containing non-abstract methods when using Java 8** option to report only the classes with `static` methods and non-abstract methods that can be converted to\n`default` methods (only applicable to language level of 8 or higher).\n\n\nInspection ID: ClassMayBeInterface"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ClassMayBeInterface",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryCallToStringValueOf",
+ "shortDescription": {
+ "text": "Unnecessary conversion to 'String'"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. 'String.valueOf()' or 'Integer.toString()'. Such calls are unnecessary when used in string concatenations. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Additionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls that can be replaced with a concatenation with the empty string option to also report cases where concatenations with the empty string can be used instead of a call to 'String.valueOf()'. Inspection ID: UnnecessaryCallToStringValueOf",
+ "markdown": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. `String.valueOf()` or `Integer.toString()`. Such calls are unnecessary when used in string concatenations.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nAdditionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls that can be replaced with a concatenation with the empty string**\noption to also report cases where concatenations with the empty string can be used instead of a call to `String.valueOf()`.\n\nInspection ID: UnnecessaryCallToStringValueOf"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryCallToStringValueOf",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringReplaceableByStringBuffer",
+ "shortDescription": {
+ "text": "Non-constant 'String' can be replaced with 'StringBuilder'"
+ },
+ "fullDescription": {
+ "text": "Reports variables declared as 'java.lang.String' that are repeatedly appended to. Such variables could be declared more efficiently as 'java.lang.StringBuffer' or 'java.lang.StringBuilder'. Example: 'String s = \"\";\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s = s + name;\n }' Such a loop can be replaced with: 'StringBuilder s = new StringBuilder();\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s.append(name);\n }' Or even with: 'String s = String.join(\" \", names);' Use the option to make this inspection only report when the variable is appended to in a loop. Inspection ID: StringReplaceableByStringBuffer",
+ "markdown": "Reports variables declared as `java.lang.String` that are repeatedly appended to. Such variables could be declared more efficiently as `java.lang.StringBuffer` or `java.lang.StringBuilder`.\n\n**Example:**\n\n\n String s = \"\";\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s = s + name;\n }\n\nSuch a loop can be replaced with:\n\n\n StringBuilder s = new StringBuilder();\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s.append(name);\n }\n\nOr even with:\n\n\n String s = String.join(\" \", names);\n\n\nUse the option to make this inspection only report when the variable is appended to in a loop.\n\nInspection ID: StringReplaceableByStringBuffer"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonConstantStringShouldBeStringBuffer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FinallyBlockCannotCompleteNormally",
+ "shortDescription": {
+ "text": "'finally' block which can not complete normally"
+ },
+ "fullDescription": {
+ "text": "Reports 'return', 'throw', 'break', 'continue', and 'yield' statements that are used inside 'finally' blocks. These cause the 'finally' block to not complete normally but to complete abruptly. Any exceptions thrown from the 'try' and 'catch' blocks of the same 'try'-'catch' statement will be suppressed. Example: 'void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }' Inspection ID: FinallyBlockCannotCompleteNormally",
+ "markdown": "Reports `return`, `throw`, `break`, `continue`, and `yield` statements that are used inside `finally` blocks. These cause the `finally` block to not complete normally but to complete abruptly. Any exceptions thrown from the `try` and `catch` blocks of the same `try`-`catch` statement will be suppressed.\n\n**Example:**\n\n\n void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }\n\nInspection ID: FinallyBlockCannotCompleteNormally"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "finally",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantOnWrongSideOfComparison",
+ "shortDescription": {
+ "text": "Constant on wrong side of comparison"
+ },
+ "fullDescription": {
+ "text": "Reports comparison operations where the constant value is on the wrong side. Some coding conventions specify that constants should be on a specific side of a comparison, either left or right. Example: 'boolean compare(int x) {\n return 1 > x; // Constant '1' on the left side of the comparison\n }' After the quick-fix is applied: 'boolean compare(int x) {\n return x < 1;\n }' Use the inspection settings to choose the side of constants in comparisons and whether to warn if 'null' literals are on the wrong side. Inspection ID: ConstantOnWrongSideOfComparison New in 2019.2",
+ "markdown": "Reports comparison operations where the constant value is on the wrong side.\n\nSome coding conventions specify that constants should be on a specific side of a comparison, either left or right.\n\n**Example:**\n\n\n boolean compare(int x) {\n return 1 > x; // Constant '1' on the left side of the comparison\n }\n\nAfter the quick-fix is applied:\n\n\n boolean compare(int x) {\n return x < 1;\n }\n\n\nUse the inspection settings to choose the side of constants in comparisons\nand whether to warn if `null` literals are on the wrong side.\n\nInspection ID: ConstantOnWrongSideOfComparison\n\nNew in 2019.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantOnWrongSideOfComparison",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectToString",
+ "shortDescription": {
+ "text": "Call to default 'toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'toString()' that use the default implementation from 'java.lang.Object'. The default implementation is rarely intended but may be used by accident. Calls to 'toString()' on objects with 'java.lang.Object', interface or abstract class type are ignored by this inspection. Example: 'class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }' Inspection ID: ObjectToString",
+ "markdown": "Reports calls to `toString()` that use the default implementation from `java.lang.Object`.\n\nThe default implementation is rarely intended but may be used by accident.\n\n\nCalls to `toString()` on objects with `java.lang.Object`,\ninterface or abstract class type are ignored by this inspection.\n\n**Example:**\n\n\n class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }\n\nInspection ID: ObjectToString"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ObjectToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarilyQualifiedStaticallyImportedElement",
+ "shortDescription": {
+ "text": "Unnecessarily qualified statically imported element"
+ },
+ "fullDescription": {
+ "text": "Reports usage of statically imported members qualified with their containing class name. Such qualification is unnecessary and can be removed because statically imported members can be accessed directly by member name. Example: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }' After the quick-fix is applied: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }' Inspection ID: UnnecessarilyQualifiedStaticallyImportedElement",
+ "markdown": "Reports usage of statically imported members qualified with their containing class name.\n\nSuch qualification is unnecessary and can be removed\nbecause statically imported members can be accessed directly by member name.\n\n**Example:**\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }\n\nInspection ID: UnnecessarilyQualifiedStaticallyImportedElement"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessarilyQualifiedStaticallyImportedElement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfJDBCDriverClass",
+ "shortDescription": {
+ "text": "Use of concrete JDBC driver class"
+ },
+ "fullDescription": {
+ "text": "Reports uses of specific JDBC driver classes. Use of such classes will bind your project to a specific database and driver, defeating the purpose of JDBC and resulting in loss of portability. Example: 'import java.sql.Driver;\n\n abstract class Sample implements Driver {\n public void foo() {\n Sample sample;\n }\n }' Inspection ID: UseOfJDBCDriverClass",
+ "markdown": "Reports uses of specific JDBC driver classes. Use of such classes will bind your project to a specific database and driver, defeating the purpose of JDBC and resulting in loss of portability.\n\n**Example:**\n\n\n import java.sql.Driver;\n\n abstract class Sample implements Driver {\n public void foo() {\n Sample sample;\n }\n }\n\nInspection ID: UseOfJDBCDriverClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfJDBCDriverClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 93,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JDBCResource",
+ "shortDescription": {
+ "text": "JDBC resource opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: JDBCResource",
+ "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: JDBCResource"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JDBCResourceOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 142,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggingSimilarMessage",
+ "shortDescription": {
+ "text": "Non-distinguishable logging calls"
+ },
+ "fullDescription": {
+ "text": "Reports SLF4J, Log4j2 logging calls in one class, such as 'logger.info(\"message: {}\", key)' with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from. Example (for Java): 'private static void request1(String text) {\n log.info(\"Message: {}\", text); //similar call\n doSomething1();\n }\n\n private static void request2(int i) {\n log.info(\"Message: {}\", i); //similar call\n doSomething2();\n }' Use the Minimum length of a similar sequence option to set the minimum length of similar sequences after which calls will be reported Use the Do not report calls with the 'error' log level option to ignore messages with `error` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces Inspection ID: LoggingSimilarMessage New in 2024.1",
+ "markdown": "Reports SLF4J, Log4j2 logging calls in one class, such as `logger.info(\"message: {}\", key)` with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from.\n\n**Example (for Java):**\n\n\n private static void request1(String text) {\n log.info(\"Message: {}\", text); //similar call\n doSomething1();\n }\n\n private static void request2(int i) {\n log.info(\"Message: {}\", i); //similar call\n doSomething2();\n }\n\n* Use the **Minimum length of a similar sequence** option to set the minimum length of similar sequences after which calls will be reported\n* Use the **Do not report calls with the 'error' log level** option to ignore messages with \\`error\\` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces\n\nInspection ID: LoggingSimilarMessage\n\nNew in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LoggingSimilarMessage",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Code Style"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Logging",
+ "index": 53,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IfCanBeAssertion",
+ "shortDescription": {
+ "text": "Statement can be replaced with 'assert' or 'Objects.requireNonNull'"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements that throw only 'java.lang.Throwable' from a 'then' branch and do not have an 'else' branch. Such statements can be converted to more compact 'assert' statements. The inspection also reports Guava's 'Preconditions.checkNotNull()'. They can be replaced with a 'Objects.requireNonNull()' call for which a library may not be needed. Example: 'if (x == 2) throw new RuntimeException(\"fail\");\n if (y == null) throw new AssertionError();\n Preconditions.checkNotNull(z, \"z\");' After the quick-fix is applied: 'assert x != 2 : \"fail\";\n Objects.requireNonNull(y);\n Objects.requireNonNull(z, \"z\");' By default, this inspection provides a quick-fix in the editor without code highlighting. This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: IfCanBeAssertion",
+ "markdown": "Reports `if` statements that throw only `java.lang.Throwable` from a `then` branch and do not have an `else` branch. Such statements can be converted to more compact `assert` statements.\n\n\nThe inspection also reports Guava's `Preconditions.checkNotNull()`.\nThey can be replaced with a `Objects.requireNonNull()` call for which a library may not be needed.\n\nExample:\n\n\n if (x == 2) throw new RuntimeException(\"fail\");\n if (y == null) throw new AssertionError();\n Preconditions.checkNotNull(z, \"z\");\n\nAfter the quick-fix is applied:\n\n\n assert x != 2 : \"fail\";\n Objects.requireNonNull(y);\n Objects.requireNonNull(z, \"z\");\n\nBy default, this inspection provides a quick-fix in the editor without code highlighting.\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: IfCanBeAssertion"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "IfCanBeAssertion",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavadocDeclaration",
+ "shortDescription": {
+ "text": "Javadoc declaration problems"
+ },
+ "fullDescription": {
+ "text": "Reports Javadoc comments and tags with the following problems: invalid tag names incomplete tag descriptions duplicated tags missing Javadoc descriptions Example: '/**\n * Invalid tag name\n * @poram param description\n */\n public void sample(int param){\n }' Example: '/**\n * Pointing to itself {@link #sample(int)}\n */\n public void sample(int param){\n }' Quick-fix adds the unknown Javadoc tag to the list of user defined additional tags. Inspection ID: JavadocDeclaration",
+ "markdown": "Reports Javadoc comments and tags with the following problems:\n\n* invalid tag names\n* incomplete tag descriptions\n* duplicated tags\n* missing Javadoc descriptions\n\nExample:\n\n\n /**\n * Invalid tag name\n * @poram param description\n */\n public void sample(int param){\n }\n\nExample:\n\n\n /**\n * Pointing to itself {@link #sample(int)}\n */\n public void sample(int param){\n }\n\nQuick-fix adds the unknown Javadoc tag to the list of user defined additional tags.\n\nInspection ID: JavadocDeclaration"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocDeclaration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToMethodParameter",
+ "shortDescription": {
+ "text": "Assignment to method parameter"
+ },
+ "fullDescription": {
+ "text": "Reports assignment to, or modification of method parameters. Although occasionally intended, this construct may be confusing and is therefore prohibited in some Java projects. The quick-fix adds a declaration of a new variable. Example: 'void printTrimmed(String s) {\n s = s.trim();\n System.out.println(s);\n }' After the quick-fix is applied: 'void printTrimmed(String s) {\n String trimmed = s.trim();\n System.out.println(trimmed);\n }' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value. Inspection ID: AssignmentToMethodParameter",
+ "markdown": "Reports assignment to, or modification of method parameters.\n\nAlthough occasionally intended, this construct may be confusing\nand is therefore prohibited in some Java projects.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n void printTrimmed(String s) {\n s = s.trim();\n System.out.println(s);\n }\n\nAfter the quick-fix is applied:\n\n\n void printTrimmed(String s) {\n String trimmed = s.trim();\n System.out.println(trimmed);\n }\n\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify\nthe parameter value based on its previous value.\n\nInspection ID: AssignmentToMethodParameter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToMethodParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 83,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LocalVariableHidingMemberVariable",
+ "shortDescription": {
+ "text": "Local variable hides field"
+ },
+ "fullDescription": {
+ "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class. Inspection ID: LocalVariableHidingMemberVariable",
+ "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class.\n\nInspection ID: LocalVariableHidingMemberVariable"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LocalVariableHidesMemberVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryTemporaryOnConversionToString",
+ "shortDescription": {
+ "text": "Unnecessary temporary object in conversion to 'String'"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary creation of temporary objects when converting from a primitive type to 'String'. Example: 'String foo = new Integer(3).toString();' After the quick-fix is applied: 'String foo = Integer.toString(3);' Inspection ID: UnnecessaryTemporaryOnConversionToString",
+ "markdown": "Reports unnecessary creation of temporary objects when converting from a primitive type to `String`.\n\n**Example:**\n\n\n String foo = new Integer(3).toString();\n\nAfter the quick-fix is applied:\n\n\n String foo = Integer.toString(3);\n\nInspection ID: UnnecessaryTemporaryOnConversionToString"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryTemporaryOnConversionToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceMayBeAnnotatedFunctional",
+ "shortDescription": {
+ "text": "Interface may be annotated as '@FunctionalInterface'"
+ },
+ "fullDescription": {
+ "text": "Reports interfaces that can be annotated with '@FunctionalInterface'. Annotating an interface with '@FunctionalInterface' indicates that the interface is functional and no more 'abstract' methods can be added to it. Example: 'interface FileProcessor {\n void execute(File file);\n }' After the quick-fix is applied: '@FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: InterfaceMayBeAnnotatedFunctional",
+ "markdown": "Reports interfaces that can be annotated with `@FunctionalInterface`.\n\nAnnotating an interface with `@FunctionalInterface` indicates that the interface\nis functional and no more `abstract` methods can be added to it.\n\n**Example:**\n\n\n interface FileProcessor {\n void execute(File file);\n }\n\nAfter the quick-fix is applied:\n\n\n @FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: InterfaceMayBeAnnotatedFunctional"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceMayBeAnnotatedFunctional",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BreakStatementWithLabel",
+ "shortDescription": {
+ "text": "'break' statement with label"
+ },
+ "fullDescription": {
+ "text": "Reports 'break' statements with labels. Labeled 'break' statements complicate refactoring and can be confusing. Example: 'void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) break outer;\n handleChar(ch);\n }\n }\n }' Inspection ID: BreakStatementWithLabel",
+ "markdown": "Reports `break` statements with labels.\n\nLabeled `break` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) break outer;\n handleChar(ch);\n }\n }\n }\n\n\nInspection ID: BreakStatementWithLabel"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BreakStatementWithLabel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousLiteralUnderscore",
+ "shortDescription": {
+ "text": "Suspicious underscore in number literal"
+ },
+ "fullDescription": {
+ "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;' Inspection ID: SuspiciousLiteralUnderscore",
+ "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`\n\n\nInspection ID: SuspiciousLiteralUnderscore"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousLiteralUnderscore",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringEquality",
+ "shortDescription": {
+ "text": "String comparison using '==', instead of 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }' Inspection ID: StringEquality",
+ "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n\n\nInspection ID: StringEquality"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringEquality",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticCallOnSubclass",
+ "shortDescription": {
+ "text": "Static method referenced via subclass"
+ },
+ "fullDescription": {
+ "text": "Reports static method calls where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself. Java allows such qualification for classes, but such calls may indicate a subtle confusion of inheritance and overriding. Example: 'class Parent {\n public static void print(String str) {}\n }\n class Child extends Parent {}\n\n Child.print(\"Hello, world!\");' After the quick-fix is applied: 'Parent.print(\"Hello, world!\");' Inspection ID: StaticCallOnSubclass",
+ "markdown": "Reports static method calls where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself.\n\n\nJava allows such qualification for classes, but such calls\nmay indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Parent {\n public static void print(String str) {}\n }\n class Child extends Parent {}\n\n Child.print(\"Hello, world!\");\n\nAfter the quick-fix is applied:\n\n\n Parent.print(\"Hello, world!\");\n\nInspection ID: StaticCallOnSubclass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticMethodReferencedViaSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadResolveAndWriteReplaceProtected",
+ "shortDescription": {
+ "text": "'readResolve()' or 'writeReplace()' not declared 'protected'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that implement 'java.io.Serializable' where the 'readResolve()' or 'writeReplace()' methods are not declared 'protected'. Declaring 'readResolve()' and 'writeReplace()' methods 'private' can force subclasses to silently ignore them, while declaring them 'public' allows them to be invoked by untrusted code. If the containing class is declared 'final', these methods can be declared 'private'. Example: 'class ClassWithSerialization implements Serializable {\n public Object writeReplace() { // warning: 'writeReplace()' not declared protected\n ...\n }\n }'\n Inspection ID: ReadResolveAndWriteReplaceProtected",
+ "markdown": "Reports classes that implement `java.io.Serializable` where the `readResolve()` or `writeReplace()` methods are not declared `protected`.\n\n\nDeclaring `readResolve()` and `writeReplace()` methods `private`\ncan force subclasses to silently ignore them, while declaring them\n`public` allows them to be invoked by untrusted code.\n\n\nIf the containing class is declared `final`, these methods can be declared `private`.\n\n**Example:**\n\n\n class ClassWithSerialization implements Serializable {\n public Object writeReplace() { // warning: 'writeReplace()' not declared protected\n ...\n }\n }\n \nInspection ID: ReadResolveAndWriteReplaceProtected"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReadResolveAndWriteReplaceProtected",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryLabelOnContinueStatement",
+ "shortDescription": {
+ "text": "Unnecessary label on 'continue' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'continue' statements with unnecessary labels. Example: 'LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }' Inspection ID: UnnecessaryLabelOnContinueStatement",
+ "markdown": "Reports `continue` statements with unnecessary labels.\n\nExample:\n\n\n LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }\n\nInspection ID: UnnecessaryLabelOnContinueStatement"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryLabelOnContinueStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterNamingConvention",
+ "shortDescription": {
+ "text": "Method parameter naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports method parameters whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'void fooBar(int X)' should be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter. Configure the inspection: Use the fields in the Options section to specify the minimum length, maximum length, and a regular expression expected for method parameter names. Specify 0 in order not to check the length of names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: ParameterNamingConvention",
+ "markdown": "Reports method parameters whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `void fooBar(int X)`\nshould be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter.\n\nConfigure the inspection:\n\n\nUse the fields in the **Options** section to specify the minimum length, maximum length, and a regular expression expected for\nmethod parameter names. Specify **0** in order not to check the length of names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: ParameterNamingConvention"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodParameterNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCanBeVariableArityMethod",
+ "shortDescription": {
+ "text": "Method can have varargs parameter"
+ },
+ "fullDescription": {
+ "text": "Reports methods that can be converted to variable arity methods. Example: 'void process(String name, Object[] objects);' After the quick-fix is applied: 'void process(String name, Object... objects);' This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: MethodCanBeVariableArityMethod",
+ "markdown": "Reports methods that can be converted to variable arity methods.\n\n**Example:**\n\n\n void process(String name, Object[] objects);\n\nAfter the quick-fix is applied:\n\n\n void process(String name, Object... objects);\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: MethodCanBeVariableArityMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MethodCanBeVariableArityMethod",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractClassNeverImplemented",
+ "shortDescription": {
+ "text": "Abstract class which has no concrete subclass"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' classes that have no concrete subclasses. Deprecated abstract classes are not reported. Inspection ID: AbstractClassNeverImplemented",
+ "markdown": "Reports `abstract` classes that have no concrete subclasses. Deprecated abstract classes are not reported.\n\nInspection ID: AbstractClassNeverImplemented"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractClassNeverImplemented",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StreamToLoop",
+ "shortDescription": {
+ "text": "Stream API call chain can be replaced with loop"
+ },
+ "fullDescription": {
+ "text": "Reports Stream API chains, 'Iterable.forEach()', and 'Map.forEach()' calls that can be automatically converted into classical loops. This can help to downgrade for backward compatibility with earlier Java versions. Example: 'String joinNonEmpty(List list) {\n return list.stream() // Stream can be converted to loop\n .filter(s -> !s.isEmpty())\n .map(String::trim)\n .collect(Collectors.joining(\", \"));\n }' After the quick-fix is applied: 'String joinNonEmpty(List list) {\n StringJoiner joiner = new StringJoiner(\", \");\n for (String s : list) {\n if (!s.isEmpty()) {\n String trim = s.trim();\n joiner.add(trim);\n }\n }\n return joiner.toString();\n }' Note that sometimes this inspection might cause slight semantic changes. Special care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when the stream short-circuits. Configure the inspection: Use the Iterate unknown Stream sources via Stream.iterator() option to suggest conversions for streams with unrecognized source. In this case, iterator will be created from the stream. For example, when checkbox is selected, the conversion will be suggested here: 'List handles = ProcessHandle.allProcesses().collect(Collectors.toList());' In this case, the result will be as follows: 'List handles = new ArrayList<>();\n for (Iterator it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {\n ProcessHandle allProcess = it.next();\n handles.add(allProcess);\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: StreamToLoop New in 2017.1",
+ "markdown": "Reports Stream API chains, `Iterable.forEach()`, and `Map.forEach()` calls that can be automatically converted into classical loops. This can help to downgrade for backward compatibility with earlier Java versions.\n\n**Example:**\n\n\n String joinNonEmpty(List list) {\n return list.stream() // Stream can be converted to loop\n .filter(s -> !s.isEmpty())\n .map(String::trim)\n .collect(Collectors.joining(\", \"));\n }\n\nAfter the quick-fix is applied:\n\n\n String joinNonEmpty(List list) {\n StringJoiner joiner = new StringJoiner(\", \");\n for (String s : list) {\n if (!s.isEmpty()) {\n String trim = s.trim();\n joiner.add(trim);\n }\n }\n return joiner.toString();\n }\n\n\nNote that sometimes this inspection might cause slight semantic changes.\nSpecial care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when\nthe stream short-circuits.\n\nConfigure the inspection:\n\nUse the **Iterate unknown Stream sources via Stream.iterator()** option to suggest conversions for streams with unrecognized source.\nIn this case, iterator will be created from the stream.\nFor example, when checkbox is selected, the conversion will be suggested here:\n\n\n List handles = ProcessHandle.allProcesses().collect(Collectors.toList());\n\nIn this case, the result will be as follows:\n\n\n List handles = new ArrayList<>();\n for (Iterator it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {\n ProcessHandle allProcess = it.next();\n handles.add(allProcess);\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: StreamToLoop\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "StreamToLoop",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NotifyWithoutCorrespondingWait",
+ "shortDescription": {
+ "text": "'notify()' without corresponding 'wait()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Object.notify()' or 'Object.notifyAll()' for which no call to a corresponding 'Object.wait()' can be found. Only calls that target fields of the current class are reported by this inspection. Example: 'synchronized (synList) {\n synList.notify(); //synList.wait() is never called\n }' Inspection ID: NotifyWithoutCorrespondingWait",
+ "markdown": "Reports calls to `Object.notify()` or `Object.notifyAll()` for which no call to a corresponding `Object.wait()` can be found.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n synchronized (synList) {\n synList.notify(); //synList.wait() is never called\n }\n\nInspection ID: NotifyWithoutCorrespondingWait"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NotifyWithoutCorrespondingWait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassInitializerMayBeStatic",
+ "shortDescription": {
+ "text": "Instance initializer can be made 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports instance initializers which can be made 'static' without producing any errors. An instance initializer may be static if it does not reference any of its class' non-static members. Static initializers are executed once when the class is resolved, while instance initializers are executed on each instantiation of the class. This inspection doesn't report instance empty initializers and initializers in anonymous classes. Example: 'class A {\n public static String CONSTANT;\n {\n CONSTANT = \"Hello\";\n }\n }' After the quick-fix is applied: 'class A {\n public static String CONSTANT;\n static {\n CONSTANT = \"Hello\"; //now initialized only once per class\n }\n }' Inspection ID: ClassInitializerMayBeStatic",
+ "markdown": "Reports instance initializers which can be made `static` without producing any errors.\n\n\nAn instance initializer may be static if it does not reference any of its class' non-static members.\nStatic initializers are executed once when the class is resolved,\nwhile instance initializers are executed on each instantiation of the class.\n\nThis inspection doesn't report instance empty initializers and initializers in anonymous classes.\n\n**Example:**\n\n\n class A {\n public static String CONSTANT;\n {\n CONSTANT = \"Hello\";\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class A {\n public static String CONSTANT;\n static {\n CONSTANT = \"Hello\"; //now initialized only once per class\n }\n }\n\nInspection ID: ClassInitializerMayBeStatic"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassInitializerMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MagicCharacter",
+ "shortDescription": {
+ "text": "Magic character"
+ },
+ "fullDescription": {
+ "text": "Reports character literals that are used without constant declaration. These characters might result in bad code readability. Also, there might be errors if a character is changed only in one location but not everywhere in code. Example: 'char c = 'c';' Inspection ID: MagicCharacter",
+ "markdown": "Reports character literals that are used without constant declaration. These characters might result in bad code readability. Also, there might be errors if a character is changed only in one location but not everywhere in code.\n\n**Example:**\n\n char c = 'c';\n\nInspection ID: MagicCharacter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MagicCharacter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 7,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SlowAbstractSetRemoveAll",
+ "shortDescription": {
+ "text": "Call to 'set.removeAll(list)' may work slowly"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.util.Set.removeAll()' with a 'java.util.List' argument. Such a call can be slow when the size of the argument is greater than or equal to the size of the set, and the set is a subclass of 'java.util.AbstractSet'. In this case, 'List.contains()' is called for each element in the set, which will perform a linear search. Example: 'public void check(String... ss) {\n // possible O(n^2) complexity\n mySet.removeAll(List.of(ss));\n }' After the quick fix is applied: 'public void check(String... ss) {\n // O(n) complexity\n List.of(ss).forEach(mySet::remove);\n }' Inspection ID: SlowAbstractSetRemoveAll New in 2020.3",
+ "markdown": "Reports calls to `java.util.Set.removeAll()` with a `java.util.List` argument.\n\n\nSuch a call can be slow when the size of the argument is greater than or equal to the size of the set,\nand the set is a subclass of `java.util.AbstractSet`.\nIn this case, `List.contains()` is called for each element in the set, which will perform a linear search.\n\n**Example:**\n\n\n public void check(String... ss) {\n // possible O(n^2) complexity\n mySet.removeAll(List.of(ss));\n }\n\nAfter the quick fix is applied:\n\n\n public void check(String... ss) {\n // O(n) complexity\n List.of(ss).forEach(mySet::remove);\n }\n\nInspection ID: SlowAbstractSetRemoveAll\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SlowAbstractSetRemoveAll",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayEquality",
+ "shortDescription": {
+ "text": "Array comparison using '==', instead of 'Arrays.equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports operators '==' and '!=' used to test for array equality. In most cases, testing for the equality of array contents is intended, which can be done with the 'java.util.Arrays.equals()' method. A quick-fix is suggested to replace '==' with 'java.util.Arrays.equals()'. Example: 'void foo(Object[] x, Object[] y) {\n boolean comparison = x == y;\n }' After the quick-fix is applied: 'void foo(Object[] x, Object[] y) {\n boolean comparison = Arrays.equals(x, y);\n }' Inspection ID: ArrayEquality",
+ "markdown": "Reports operators `==` and `!=` used to test for array equality. In most cases, testing for the equality of array contents is intended, which can be done with the `java.util.Arrays.equals()` method.\n\n\nA quick-fix is suggested to replace `==` with `java.util.Arrays.equals()`.\n\n**Example:**\n\n\n void foo(Object[] x, Object[] y) {\n boolean comparison = x == y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(Object[] x, Object[] y) {\n boolean comparison = Arrays.equals(x, y);\n }\n\nInspection ID: ArrayEquality"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayEquality",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticCollection",
+ "shortDescription": {
+ "text": "Static collection"
+ },
+ "fullDescription": {
+ "text": "Reports static fields of a 'Collection' type. While it's not necessarily a problem, static collections often cause memory leaks and are therefore prohibited by some coding standards. Example: 'public class Example {\n static List list = new ArrayList<>();\n\n }' Configure the inspection: Use the Ignore weak static collections or maps option to ignore the fields of the 'java.util.WeakHashMap' type. Inspection ID: StaticCollection",
+ "markdown": "Reports static fields of a `Collection` type. While it's not necessarily a problem, static collections often cause memory leaks and are therefore prohibited by some coding standards.\n\n**Example:**\n\n\n public class Example {\n static List list = new ArrayList<>();\n\n }\n\n\nConfigure the inspection:\n\n* Use the **Ignore weak static collections or maps** option to ignore the fields of the `java.util.WeakHashMap` type.\n\nInspection ID: StaticCollection"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticCollection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 175,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonExceptionNameEndsWithException",
+ "shortDescription": {
+ "text": "Non-exception class name ends with 'Exception'"
+ },
+ "fullDescription": {
+ "text": "Reports non-'exception' classes whose names end with 'Exception'. Such classes may cause confusion by breaking a common naming convention and often indicate that the 'extends Exception' clause is missing. Example: 'public class NotStartedException {}' A quick-fix that renames such classes is available only in the editor. Inspection ID: NonExceptionNameEndsWithException",
+ "markdown": "Reports non-`exception` classes whose names end with `Exception`.\n\nSuch classes may cause confusion by breaking a common naming convention and\noften indicate that the `extends Exception` clause is missing.\n\n**Example:**\n\n public class NotStartedException {}\n\nA quick-fix that renames such classes is available only in the editor.\n\nInspection ID: NonExceptionNameEndsWithException"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonExceptionNameEndsWithException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 77,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemGC",
+ "shortDescription": {
+ "text": "Call to 'System.gc()' or 'Runtime.gc()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues. Inspection ID: SystemGC",
+ "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues.\n\nInspection ID: SystemGC"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSystemGC",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 175,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassComplexity",
+ "shortDescription": {
+ "text": "Overly complex class"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class. Inspection ID: ClassComplexity",
+ "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class.\n\nInspection ID: ClassComplexity"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 127,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverflowingLoopIndex",
+ "shortDescription": {
+ "text": "Loop executes zero or billions of times"
+ },
+ "fullDescription": {
+ "text": "Reports loops that cannot be completed without an index overflow or loops that don't loop at all. It usually happens because of a mistake in the update operation. Example: 'void foo(int s) {\n for (int i = s; i > 12; i++) { // i-- should be here\n System.out.println(i);\n }\n }' Inspection ID: OverflowingLoopIndex New in 2019.1",
+ "markdown": "Reports loops that cannot be completed without an index overflow or loops that don't loop at all. It usually happens because of a mistake in the update operation.\n\nExample:\n\n\n void foo(int s) {\n for (int i = s; i > 12; i++) { // i-- should be here\n System.out.println(i);\n }\n }\n\nInspection ID: OverflowingLoopIndex\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverflowingLoopIndex",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9UndeclaredServiceUsage",
+ "shortDescription": {
+ "text": "Usage of service not declared in 'module-info'"
+ },
+ "fullDescription": {
+ "text": "Reports situations in which a service is loaded with 'java.util.ServiceLoader' but it isn't declared with the 'uses' clause in the 'module-info.java' file and suggests inserting it. This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: Java9UndeclaredServiceUsage New in 2018.1",
+ "markdown": "Reports situations in which a service is loaded with `java.util.ServiceLoader` but it isn't declared with the `uses` clause in the `module-info.java` file and suggests inserting it.\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: Java9UndeclaredServiceUsage\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9UndeclaredServiceUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SetReplaceableByEnumSet",
+ "shortDescription": {
+ "text": "'Set' can be replaced with 'EnumSet'"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);' Inspection ID: SetReplaceableByEnumSet",
+ "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n\nInspection ID: SetReplaceableByEnumSet"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SetReplaceableByEnumSet",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassMayBeStatic",
+ "shortDescription": {
+ "text": "Inner class may be 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. When using Java 17 or before, this prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' Inspection ID: InnerClassMayBeStatic",
+ "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nWhen using Java 17 or before,\nthis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nInspection ID: InnerClassMayBeStatic"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 175,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CallToSimpleSetterInClass",
+ "shortDescription": {
+ "text": "Call to simple setter from within class"
+ },
+ "fullDescription": {
+ "text": "Reports calls to a simple property setter from within the property's class. A simple property setter is defined as one which simply assigns the value of its parameter to a field, and does no other calculations. Such simple setter calls can be safely inlined. Some coding standards also suggest against the use of simple setters for code clarity reasons. Example: 'class Foo {\n private int index;\n public Foo(int idx) {\n setIndex(idx);\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }' After the quick-fix is applied: 'class Foo {\n private int index;\n public Foo(int idx) {\n index = idx;\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }' Use the following options to configure the inspection: Whether to only report setter calls on 'this', not on objects of the same type passed in as a parameter. Whether to ignore non-'private' setters. Inspection ID: CallToSimpleSetterInClass",
+ "markdown": "Reports calls to a simple property setter from within the property's class.\n\n\nA simple property setter is defined as one which simply assigns the value of its parameter to a field,\nand does no other calculations. Such simple setter calls can be safely inlined.\nSome coding standards also suggest against the use of simple setters for code clarity reasons.\n\n**Example:**\n\n\n class Foo {\n private int index;\n public Foo(int idx) {\n setIndex(idx);\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n private int index;\n public Foo(int idx) {\n index = idx;\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }\n\nUse the following options to configure the inspection:\n\n* Whether to only report setter calls on `this`, not on objects of the same type passed in as a parameter.\n* Whether to ignore non-`private` setters.\n\nInspection ID: CallToSimpleSetterInClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSimpleSetterFromWithinClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryFinalOnLocalVariableOrParameter",
+ "shortDescription": {
+ "text": "Unnecessary 'final' on local variable or parameter"
+ },
+ "fullDescription": {
+ "text": "Reports local variables or parameters unnecessarily declared 'final'. Some coding standards frown upon variables declared 'final' for reasons of terseness. Example: 'class Foo {\n Foo(Object o) {}\n\n void bar(final Object o) {\n new Foo(o);\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo(Object o) {}\n\n void bar(Object o) {\n new Foo(o);\n }\n }' Use the inspection options to toggle the reporting for: local variables parameters (including parameters of 'catch' blocks and enhanced 'for' statements) Also, you can configure the inspection to only report 'final' parameters of 'abstract' or interface methods, which may be considered extra unnecessary as such markings don't affect the implementation of these methods. Inspection ID: UnnecessaryFinalOnLocalVariableOrParameter",
+ "markdown": "Reports local variables or parameters unnecessarily declared `final`.\n\nSome coding standards frown upon variables declared `final` for reasons of terseness.\n\n**Example:**\n\n\n class Foo {\n Foo(Object o) {}\n\n void bar(final Object o) {\n new Foo(o);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo(Object o) {}\n\n void bar(Object o) {\n new Foo(o);\n }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* local variables\n* parameters (including parameters of `catch` blocks and enhanced `for` statements)\n\n\nAlso, you can configure the inspection to only report `final` parameters of `abstract` or interface\nmethods, which may be considered extra unnecessary as such markings don't\naffect the implementation of these methods.\n\nInspection ID: UnnecessaryFinalOnLocalVariableOrParameter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryFinalOnLocalVariableOrParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonBooleanMethodNameMayNotStartWithQuestion",
+ "shortDescription": {
+ "text": "Non-boolean method name must not start with question word"
+ },
+ "fullDescription": {
+ "text": "Reports non-boolean methods whose names start with a question word. Such method names may be confusing. Non-boolean methods that override library methods are ignored by this inspection. Example: 'public void hasName(String name) {\n assert names.contains(name);\n }' A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the Boolean method name prefixes list to specify the question words that should be used only for boolean methods. Use the Ignore methods with 'java.lang.Boolean' return type option to ignore methods with 'java.lang.Boolean' return type. Use the Ignore methods overriding/implementing a super method option to ignore methods which have supers. Inspection ID: NonBooleanMethodNameMayNotStartWithQuestion",
+ "markdown": "Reports non-boolean methods whose names start with a question word. Such method names may be confusing.\n\nNon-boolean methods that override library methods are ignored by this inspection.\n\n**Example:**\n\n\n public void hasName(String name) {\n assert names.contains(name);\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\n* Use the **Boolean method name prefixes** list to specify the question words that should be used only for boolean methods.\n* Use the **Ignore methods with 'java.lang.Boolean' return type** option to ignore methods with `java.lang.Boolean` return type.\n* Use the **Ignore methods overriding/implementing a super method** option to ignore methods which have supers.\n\nInspection ID: NonBooleanMethodNameMayNotStartWithQuestion"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonBooleanMethodNameMayNotStartWithQuestion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 108,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WeakerAccess",
+ "shortDescription": {
+ "text": "Declaration access can be weaker"
+ },
+ "fullDescription": {
+ "text": "Reports fields, methods or classes that may have their access modifier narrowed down. Example: 'class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }' After the quick-fix is applied: 'class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }' Use the inspection's options to define the rules for the modifier change suggestions. Inspection ID: WeakerAccess",
+ "markdown": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions.\n\nInspection ID: WeakerAccess"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WeakerAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReplaceWithJavadoc",
+ "shortDescription": {
+ "text": "Comment replaceable with Javadoc"
+ },
+ "fullDescription": {
+ "text": "Reports a regular comment that belongs to a field, method, or class that can be replaced with a Javadoc comment. Example: 'public class Main {\n /*\n * Hello,\n */\n // World!\n void f() {\n }\n }' After the quick-fix is applied: 'public class Main {\n /**\n * Hello,\n * World!\n */\n void f() {\n }\n }' Inspection ID: ReplaceWithJavadoc",
+ "markdown": "Reports a regular comment that belongs to a field, method, or class that can be replaced with a Javadoc comment.\n\n**Example:**\n\n\n public class Main {\n /*\n * Hello,\n */\n // World!\n void f() {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n /**\n * Hello,\n * World!\n */\n void f() {\n }\n }\n\nInspection ID: ReplaceWithJavadoc"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ReplaceWithJavadoc",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WrapperTypeMayBePrimitive",
+ "shortDescription": {
+ "text": "Wrapper type may be primitive"
+ },
+ "fullDescription": {
+ "text": "Reports local variables of wrapper type that are mostly used as primitive types. In some cases, boxing can be source of significant performance penalty, especially in loops. Heuristics are applied to estimate the number of boxing operations. For example, conversions inside loops are considered as much more numerous. Example: 'public void example() {\n Integer value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}' After the quick-fix is applied: 'public void example() {\n int value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}' New in 2018.2 Inspection ID: WrapperTypeMayBePrimitive",
+ "markdown": "Reports local variables of wrapper type that are mostly used as primitive types.\n\nIn some cases, boxing can be source of significant performance penalty, especially in loops.\n\nHeuristics are applied to estimate the number of boxing operations. For example, conversions inside loops are considered\nas much more numerous.\n\n**Example:**\n\n public void example() {\n Integer value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}\n\nAfter the quick-fix is applied:\n\n public void example() {\n int value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}\n\n\nNew in 2018.2\n\nInspection ID: WrapperTypeMayBePrimitive"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WrapperTypeMayBePrimitive",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyStatementBody",
+ "shortDescription": {
+ "text": "Statement with empty body"
+ },
+ "fullDescription": {
+ "text": "Reports 'if', 'while', 'do', 'for', and 'switch' statements with empty bodies. While occasionally intended, such code is confusing and is often the result of a typo. This inspection is disabled in JSP files. Inspection ID: EmptyStatementBody",
+ "markdown": "Reports `if`, `while`, `do`, `for`, and `switch` statements with empty bodies.\n\nWhile occasionally intended, such code is confusing and is often the result of a typo.\n\nThis inspection is disabled in JSP files.\n\nInspection ID: EmptyStatementBody"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StatementWithEmptyBody",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyFinallyBlock",
+ "shortDescription": {
+ "text": "Empty 'finally' block"
+ },
+ "fullDescription": {
+ "text": "Reports empty 'finally' blocks. Empty 'finally' blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed. This inspection doesn't report empty 'finally' blocks found in JSP files. Example: 'try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }' After the quick-fix is applied: 'try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }' Inspection ID: EmptyFinallyBlock",
+ "markdown": "Reports empty `finally` blocks.\n\nEmpty `finally` blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed.\n\nThis inspection doesn't report empty `finally` blocks found in JSP files.\n\n**Example:**\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n\nInspection ID: EmptyFinallyBlock"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptyFinallyBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InconsistentLanguageLevel",
+ "shortDescription": {
+ "text": "Inconsistent language level settings"
+ },
+ "fullDescription": {
+ "text": "Reports modules which depend on other modules with a higher language level. Such dependencies should be removed or the language level of the module be increased. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: InconsistentLanguageLevel",
+ "markdown": "Reports modules which depend on other modules with a higher language level.\n\nSuch dependencies should be removed or the language level of the module be increased.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: InconsistentLanguageLevel"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InconsistentLanguageLevel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Modularization issues",
+ "index": 73,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnumerationCanBeIteration",
+ "shortDescription": {
+ "text": "Enumeration can be iteration"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Enumeration' methods that are used on collections and may be replaced with equivalent 'Iterator' constructs. Example: 'Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }' After the quick-fix is applied: 'Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }' Inspection ID: EnumerationCanBeIteration",
+ "markdown": "Reports calls to `Enumeration` methods that are used on collections and may be replaced with equivalent `Iterator` constructs.\n\n**Example:**\n\n\n Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }\n\nAfter the quick-fix is applied:\n\n\n Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }\n\nInspection ID: EnumerationCanBeIteration"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EnumerationCanBeIteration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids",
+ "index": 84,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FinalStaticMethod",
+ "shortDescription": {
+ "text": "'static' method declared 'final'"
+ },
+ "fullDescription": {
+ "text": "Reports static methods that are marked as 'final'. Such code might indicate an error or an incorrect assumption about the effect of the 'final' keyword. Static methods are not subject to runtime polymorphism, so the only purpose of the 'final' keyword used with static methods is to ensure the method will not be hidden in a subclass. Inspection ID: FinalStaticMethod",
+ "markdown": "Reports static methods that are marked as `final`.\n\nSuch code might indicate an error or an incorrect assumption about the effect of the `final` keyword.\nStatic methods are not subject to runtime polymorphism, so the only purpose of the `final` keyword used with static methods\nis to ensure the method will not be hidden in a subclass.\n\n\nInspection ID: FinalStaticMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FinalStaticMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantTypeArguments",
+ "shortDescription": {
+ "text": "Redundant type arguments"
+ },
+ "fullDescription": {
+ "text": "Reports calls to parametrized methods with explicit argument types that can be omitted since they will be unambiguously inferred by the compiler. Using redundant type arguments is unnecessary and makes the code less readable. Example: 'List list = Arrays.asList(\"Hello\", \"World\");' A quick-fix is provided to remove redundant type arguments: 'List list = Arrays.asList(\"Hello\", \"World\");' Inspection ID: RedundantTypeArguments",
+ "markdown": "Reports calls to parametrized methods with explicit argument types that can be omitted since they will be unambiguously inferred by the compiler.\n\n\nUsing redundant type arguments is unnecessary and makes the code less readable.\n\nExample:\n\n\n List list = Arrays.asList(\"Hello\", \"World\");\n\nA quick-fix is provided to remove redundant type arguments:\n\n\n List list = Arrays.asList(\"Hello\", \"World\");\n\nInspection ID: RedundantTypeArguments"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantTypeArguments",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldHasSetterButNoGetter",
+ "shortDescription": {
+ "text": "Field has setter but no getter"
+ },
+ "fullDescription": {
+ "text": "Reports fields that have setter methods but no getter methods. In certain bean containers, when used within the Java beans specification, such fields might be difficult to work with. Inspection ID: FieldHasSetterButNoGetter",
+ "markdown": "Reports fields that have setter methods but no getter methods.\n\n\nIn certain bean containers, when used within the Java beans specification, such fields might be difficult\nto work with.\n\nInspection ID: FieldHasSetterButNoGetter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldHasSetterButNoGetter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 147,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RuntimeExecWithNonConstantString",
+ "shortDescription": {
+ "text": "Call to 'Runtime.exec()' with non-constant string"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";' Inspection ID: RuntimeExecWithNonConstantString",
+ "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n\n\nInspection ID: RuntimeExecWithNonConstantString"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToRuntimeExecWithNonConstantString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ErrorRethrown",
+ "shortDescription": {
+ "text": "'Error' not rethrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'try' statements that catch 'java.lang.Error' or any of its subclasses and do not rethrow the error. Statements that catch 'java.lang.ThreadDeath' are not reported. Example: 'try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }' Inspection ID: ErrorRethrown",
+ "markdown": "Reports `try` statements that catch `java.lang.Error` or any of its subclasses and do not rethrow the error.\n\nStatements that catch `java.lang.ThreadDeath` are not\nreported.\n\n**Example:**\n\n\n try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }\n\nInspection ID: ErrorRethrown"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ErrorNotRethrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CyclicPackageDependency",
+ "shortDescription": {
+ "text": "Cyclic package dependency"
+ },
+ "fullDescription": {
+ "text": "Reports packages that are mutually or cyclically dependent on other packages. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: CyclicPackageDependency",
+ "markdown": "Reports packages that are mutually or cyclically dependent on other packages.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: CyclicPackageDependency"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CyclicPackageDependency",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 152,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemSetSecurityManager",
+ "shortDescription": {
+ "text": "Call to 'System.setSecurityManager()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'System.setSecurityManager()'. While often benign, any call to 'System.setSecurityManager()' should be closely examined in any security audit. Inspection ID: SystemSetSecurityManager",
+ "markdown": "Reports calls to `System.setSecurityManager()`.\n\nWhile often benign, any call to `System.setSecurityManager()` should be closely examined in any security audit.\n\nInspection ID: SystemSetSecurityManager"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSystemSetSecurityManager",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnsatisfiedRange",
+ "shortDescription": {
+ "text": "Return value is outside of declared range"
+ },
+ "fullDescription": {
+ "text": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations: 'org.jetbrains.annotations.Range' from JetBrains annotations package (specify 'from' and 'to') 'org.checkerframework.common.value.qual.IntRange' from Checker Framework annotations package (specify 'from' and 'to') 'org.checkerframework.checker.index.qual.GTENegativeOne' from Checker Framework annotations package (range is '>= -1') 'org.checkerframework.checker.index.qual.NonNegative' from Checker Framework annotations package (range is '>= 0') 'org.checkerframework.checker.index.qual.Positive' from Checker Framework annotations package (range is '> 0') 'javax.annotation.Nonnegative' from JSR 305 annotations package (range is '>= 0') 'javax.validation.constraints.Min' (specify minimum value) 'javax.validation.constraints.Max' (specify maximum value) Example: '@Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }' Inspection ID: UnsatisfiedRange New in 2021.2",
+ "markdown": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations:\n\n* `org.jetbrains.annotations.Range` from JetBrains annotations package (specify 'from' and 'to')\n* `org.checkerframework.common.value.qual.IntRange` from Checker Framework annotations package (specify 'from' and 'to')\n* `org.checkerframework.checker.index.qual.GTENegativeOne` from Checker Framework annotations package (range is '\\>= -1')\n* `org.checkerframework.checker.index.qual.NonNegative` from Checker Framework annotations package (range is '\\>= 0')\n* `org.checkerframework.checker.index.qual.Positive` from Checker Framework annotations package (range is '\\> 0')\n* `javax.annotation.Nonnegative` from JSR 305 annotations package (range is '\\>= 0')\n* `javax.validation.constraints.Min` (specify minimum value)\n* `javax.validation.constraints.Max` (specify maximum value)\n\nExample:\n\n\n @Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }\n\nInspection ID: UnsatisfiedRange\n\nNew in 2021.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnsatisfiedRange",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithoutNoArgConstructor",
+ "shortDescription": {
+ "text": "Class without no-arg constructor"
+ },
+ "fullDescription": {
+ "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes. Inspection ID: ClassWithoutNoArgConstructor",
+ "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes.\n\nInspection ID: ClassWithoutNoArgConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithoutNoArgConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 147,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithTooManyDependencies",
+ "shortDescription": {
+ "text": "Class with too many dependencies"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassWithTooManyDependencies",
+ "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassWithTooManyDependencies"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyDependencies",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 152,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CastConflictsWithInstanceof",
+ "shortDescription": {
+ "text": "Cast conflicts with 'instanceof'"
+ },
+ "fullDescription": {
+ "text": "Reports type cast expressions that are preceded by an 'instanceof' check for a different type. Although this might be intended, such a construct is most likely an error, and will result in a 'java.lang.ClassCastException' at runtime. Example: 'class Main {\n int whenCharSequenceCastToNumber(Object o){\n if (o instanceof CharSequence) {\n return ((Number) o).intValue();\n }\n return 0;\n }\n\n int earlyReturnWhenNotCharSequence(Object o){\n if (!(o instanceof CharSequence)) return 0;\n return ((Number)o).intValue();\n }\n }' Inspection ID: CastConflictsWithInstanceof",
+ "markdown": "Reports type cast expressions that are preceded by an `instanceof` check for a different type.\n\n\nAlthough this might be intended, such a construct is most likely an error, and will\nresult in a `java.lang.ClassCastException` at runtime.\n\n**Example:**\n\n\n class Main {\n int whenCharSequenceCastToNumber(Object o){\n if (o instanceof CharSequence) {\n return ((Number) o).intValue();\n }\n return 0;\n }\n\n int earlyReturnWhenNotCharSequence(Object o){\n if (!(o instanceof CharSequence)) return 0;\n return ((Number)o).intValue();\n }\n }\n\nInspection ID: CastConflictsWithInstanceof"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CastConflictsWithInstanceof",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Contract",
+ "shortDescription": {
+ "text": "Contract issues"
+ },
+ "fullDescription": {
+ "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }' Inspection ID: Contract",
+ "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n\nInspection ID: Contract"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Contract",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NewExceptionWithoutArguments",
+ "shortDescription": {
+ "text": "Exception constructor called without arguments"
+ },
+ "fullDescription": {
+ "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments' Inspection ID: NewExceptionWithoutArguments",
+ "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n\nInspection ID: NewExceptionWithoutArguments"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NewExceptionWithoutArguments",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnhancedSwitchBackwardMigration",
+ "shortDescription": {
+ "text": "Enhanced 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports enhanced 'switch' statements and expressions. Suggests replacing them with regular 'switch' statements. Example: 'boolean even = switch (condition) {\n case 1, 3, 5, 7, 9 -> false;\n default -> true;\n };' After the quick-fix is applied: 'boolean even;\n switch (condition) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 9:\n even = false;\n break;\n default:\n even = true;\n break;\n}' Enhanced 'switch' appeared in Java 14. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: EnhancedSwitchBackwardMigration New in 2019.1",
+ "markdown": "Reports enhanced `switch` statements and expressions. Suggests replacing them with regular `switch` statements.\n\n**Example:**\n\n\n boolean even = switch (condition) {\n case 1, 3, 5, 7, 9 -> false;\n default -> true;\n };\n\nAfter the quick-fix is applied:\n\n\n boolean even;\n switch (condition) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 9:\n even = false;\n break;\n default:\n even = true;\n break;\n }\n\n\n*Enhanced* `switch` appeared in Java 14.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: EnhancedSwitchBackwardMigration\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "EnhancedSwitchBackwardMigration",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 14",
+ "index": 144,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageWithTooManyClasses",
+ "shortDescription": {
+ "text": "Package with too many classes"
+ },
+ "fullDescription": {
+ "text": "Reports packages that contain too many classes. Overly large packages may indicate a lack of design clarity. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Maximum number of classes field to specify the maximum allowed number of classes in a package. Inspection ID: PackageWithTooManyClasses",
+ "markdown": "Reports packages that contain too many classes.\n\nOverly large packages may indicate a lack of design clarity.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Maximum number of classes** field to specify the maximum allowed number of classes in a package.\n\nInspection ID: PackageWithTooManyClasses"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageWithTooManyClasses",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Packaging issues",
+ "index": 47,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggingGuardedByCondition",
+ "shortDescription": {
+ "text": "Logging calls guarded by log condition"
+ },
+ "fullDescription": {
+ "text": "Reports logging calls surrounded with a guard condition. This inspection can be used to adjust with a custom code style. Example: 'public class TestObject {\n void test(Object object) {\n if(LOG.isDebugEnabled()){\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n }' After a quick-fix is applied: 'public class TestObject {\n void test(Object object) {\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }' This inspection supports Log4j2 and the SLF4J logging frameworks (except builders). Inspection ID: LoggingGuardedByCondition New in 2024.2",
+ "markdown": "Reports logging calls surrounded with a guard condition. This inspection can be used to adjust with a custom code style.\n\n**Example:**\n\n\n public class TestObject {\n void test(Object object) {\n if(LOG.isDebugEnabled()){\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n }\n\nAfter a quick-fix is applied:\n\n\n public class TestObject {\n void test(Object object) {\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n\nThis inspection supports *Log4j2* and the *SLF4J* logging frameworks (except builders).\n\nInspection ID: LoggingGuardedByCondition\n\nNew in 2024.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LoggingGuardedByCondition",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Code Style"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Logging",
+ "index": 53,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TryFinallyCanBeTryWithResources",
+ "shortDescription": {
+ "text": "'try finally' can be replaced with 'try' with resources"
+ },
+ "fullDescription": {
+ "text": "Reports 'try'-'finally' statements that can use Java 7 Automatic Resource Management, which is less error-prone. A quick-fix is available to convert a 'try'-'finally' statement into a 'try'-with-resources statement. Example: 'PrintStream printStream = new PrintStream(fileName);\n try {\n printStream.print(true);\n } finally {\n printStream.close();\n }' A quick-fix is provided to pass the cause to a constructor: 'try (PrintStream printStream = new PrintStream(fileName)) {\n printStream.print(true);\n }' This inspection depends on the Java feature 'Try-with-resources', which is available since Java 7. Inspection ID: TryFinallyCanBeTryWithResources",
+ "markdown": "Reports `try`-`finally` statements that can use Java 7 Automatic Resource Management, which is less error-prone.\n\nA quick-fix is available to convert a `try`-`finally`\nstatement into a `try`-with-resources statement.\n\n**Example:**\n\n\n PrintStream printStream = new PrintStream(fileName);\n try {\n printStream.print(true);\n } finally {\n printStream.close();\n }\n\nA quick-fix is provided to pass the cause to a constructor:\n\n\n try (PrintStream printStream = new PrintStream(fileName)) {\n printStream.print(true);\n }\n\nThis inspection depends on the Java feature 'Try-with-resources', which is available since Java 7.\n\nInspection ID: TryFinallyCanBeTryWithResources"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TryFinallyCanBeTryWithResources",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 7",
+ "index": 170,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticImportCanBeUsed",
+ "shortDescription": {
+ "text": "Static import can be used"
+ },
+ "fullDescription": {
+ "text": "Reports qualifiers, which can be replaced with 'on-demand import static' statements. The list of classes that will be checked can be configured in Settings | Editor | General | Auto Import | Java | Include auto-import of static members in completion Inspection ID: StaticImportCanBeUsed New in 2025.1",
+ "markdown": "Reports qualifiers, which can be replaced with `on-demand import static` statements. The list of classes that will be checked can be configured in [Settings \\| Editor \\| General \\| Auto Import \\| Java \\| Include auto-import of static members in\ncompletion](settings://editor.preferences.import)\n\nInspection ID: StaticImportCanBeUsed\n\nNew in 2025.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticImportCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SamePackageImport",
+ "shortDescription": {
+ "text": "Unnecessary import from the same package"
+ },
+ "fullDescription": {
+ "text": "Reports 'import' statements that refer to the same package as the containing file. Same-package files are always implicitly imported, so such 'import' statements are redundant and confusing. Since IntelliJ IDEA can automatically detect and fix such statements with its Optimize Imports command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: SamePackageImport",
+ "markdown": "Reports `import` statements that refer to the same package as the containing file.\n\n\nSame-package files are always implicitly imported, so such `import`\nstatements are redundant and confusing.\n\n\nSince IntelliJ IDEA can automatically detect and fix such statements with its **Optimize Imports**\ncommand, this inspection is mostly useful for offline reporting on code bases that you\ndon't intend to change.\n\nInspection ID: SamePackageImport"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SamePackageImport",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadLocalSetWithNull",
+ "shortDescription": {
+ "text": "'ThreadLocal.set()' with null as an argument"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.lang.ThreadLocal.set()' with null as an argument. This call does not free the resources, and it may cause a memory leak. It may happen because: Firstly, 'ThreadLocal.set(null)' finds a map associated with the current Thread. If there is no such a map, it will be created It sets key and value: 'map.set(this, value)', where 'this' refers to instance of 'ThreadLocal' 'java.lang.ThreadLocal.remove()' should be used to free the resources. Example: 'ThreadLocal threadLocal = new ThreadLocal<>();\n threadLocal.set(null);' After the quick-fix is applied: 'threadLocal.remove();' Inspection ID: ThreadLocalSetWithNull New in 2023.2",
+ "markdown": "Reports `java.lang.ThreadLocal.set()` with null as an argument.\n\nThis call does not free the resources, and it may cause a memory leak.\nIt may happen because:\n\n* Firstly, `ThreadLocal.set(null)` finds a map associated with the current Thread. If there is no such a map, it will be created\n* It sets key and value: `map.set(this, value)`, where `this` refers to instance of `ThreadLocal`\n\n`java.lang.ThreadLocal.remove()` should be used to free the resources.\n\nExample:\n\n\n ThreadLocal threadLocal = new ThreadLocal<>();\n threadLocal.set(null);\n\nAfter the quick-fix is applied:\n\n\n threadLocal.remove();\n\nInspection ID: ThreadLocalSetWithNull\n\nNew in 2023.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ThreadLocalSetWithNull",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingJavadoc",
+ "shortDescription": {
+ "text": "Missing Javadoc"
+ },
+ "fullDescription": {
+ "text": "Reports missing Javadoc comments and tags. Example: '/**\n * Missing \"@param\" is reported (if configured).\n */\n public void sample(int param){\n }' The quick-fixes add missing tag or missing Javadoc comment: '/**\n * Missing \"@param\" is reported (if configured).\n * @param param\n */\n public void sample(int param){\n }' Inspection can be configured to ignore deprecated elements or simple accessor methods like 'getField()' or 'setField()'. You can also use options below to configure required tags and minimal required visibility for the specific code elements like method, field, class, package, module. Inspection ID: MissingJavadoc",
+ "markdown": "Reports missing Javadoc comments and tags.\n\nExample:\n\n\n /**\n * Missing \"@param\" is reported (if configured).\n */\n public void sample(int param){\n }\n\nThe quick-fixes add missing tag or missing Javadoc comment:\n\n\n /**\n * Missing \"@param\" is reported (if configured).\n * @param param\n */\n public void sample(int param){\n }\n\n\nInspection can be configured to ignore deprecated elements or simple accessor methods like `getField()` or `setField()`.\nYou can also use options below to configure required tags and minimal required visibility for the specific code elements like method, field, class, package, module.\n\nInspection ID: MissingJavadoc"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MissingJavadoc",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AwaitWithoutCorrespondingSignal",
+ "shortDescription": {
+ "text": "'await()' without corresponding 'signal()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Condition.await()', for which no call to a corresponding 'Condition.signal()' or 'Condition.signalAll()' can be found. Calling 'Condition.await()' in a thread without corresponding 'Condition.signal()' may cause the thread to become disabled until it is interrupted or \"spurious wakeup\" occurs. Only calls that target fields of the current class are reported by this inspection. Example: 'class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n // isEmpty.signal();\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n isEmpty.await(); // 'await()' doesn't contain corresponding 'signal()'/'signalAll()' call\n // ...\n }\n }' Inspection ID: AwaitWithoutCorrespondingSignal",
+ "markdown": "Reports calls to `Condition.await()`, for which no call to a corresponding `Condition.signal()` or `Condition.signalAll()` can be found.\n\n\nCalling `Condition.await()` in a thread without corresponding `Condition.signal()` may cause the thread\nto become disabled until it is interrupted or \"spurious wakeup\" occurs.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n // isEmpty.signal();\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n isEmpty.await(); // 'await()' doesn't contain corresponding 'signal()'/'signalAll()' call\n // ...\n }\n }\n\nInspection ID: AwaitWithoutCorrespondingSignal"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AwaitWithoutCorrespondingSignal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9RedundantRequiresStatement",
+ "shortDescription": {
+ "text": "Redundant 'requires' directive in module-info"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1 Inspection ID: Java9RedundantRequiresStatement",
+ "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1\n\nInspection ID: Java9RedundantRequiresStatement"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9RedundantRequiresStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryLocalVariable",
+ "shortDescription": {
+ "text": "Redundant local variable"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables. Inspection ID: UnnecessaryLocalVariable",
+ "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables.\n\nInspection ID: UnnecessaryLocalVariable"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryLocalVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 65,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BusyWait",
+ "shortDescription": {
+ "text": "Busy wait"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.Thread.sleep()' that occur inside loops. Such calls are indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks as busy-waiting threads do not release locked resources. Example: 'class X {\n volatile int x;\n public void waitX() throws Exception {\n while (x > 0) {\n Thread.sleep(10);//warning: Call to 'Thread.sleep()' in a loop, probably busy-waiting\n }\n }\n }' Inspection ID: BusyWait",
+ "markdown": "Reports calls to `java.lang.Thread.sleep()` that occur inside loops.\n\nSuch calls\nare indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks\nas busy-waiting threads do not release locked resources.\n\n**Example:**\n\n\n class X {\n volatile int x;\n public void waitX() throws Exception {\n while (x > 0) {\n Thread.sleep(10);//warning: Call to 'Thread.sleep()' in a loop, probably busy-waiting\n }\n }\n }\n\n\nInspection ID: BusyWait"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BusyWait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForLoopWithMissingComponent",
+ "shortDescription": {
+ "text": "'for' loop with missing components"
+ },
+ "fullDescription": {
+ "text": "Reports 'for' loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops. Example: 'for (int i = 0;;i++) {\n // body\n }' Use the Ignore collection iterations option to ignore loops which use an iterator. This is a standard way to iterate over a collection in which the 'for' loop does not have an update clause. Inspection ID: ForLoopWithMissingComponent",
+ "markdown": "Reports `for` loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops.\n\nExample:\n\n\n for (int i = 0;;i++) {\n // body\n }\n\n\nUse the **Ignore collection iterations** option to ignore loops which use an iterator.\nThis is a standard way to iterate over a collection in which the `for` loop does not have an update clause.\n\n\nInspection ID: ForLoopWithMissingComponent"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopWithMissingComponent",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverwrittenKey",
+ "shortDescription": {
+ "text": "Overwritten Map, Set, or array element"
+ },
+ "fullDescription": {
+ "text": "Reports code that overwrites a 'Map' key, a 'Set' element, or an array element in a sequence of 'add'/'put' calls or using a Java 9 factory method like 'Set.of' (which will result in runtime exception). This usually occurs due to a copy-paste error. Example: 'map.put(\"A\", 1);\n map.put(\"B\", 2);\n map.put(\"C\", 3);\n map.put(\"D\", 4);\n map.put(\"A\", 5); // duplicating key \"A\", overwrites the previously written entry' Inspection ID: OverwrittenKey New in 2017.3",
+ "markdown": "Reports code that overwrites a `Map` key, a `Set` element, or an array element in a sequence of `add`/`put` calls or using a Java 9 factory method like `Set.of` (which will result in runtime exception).\n\nThis usually occurs due to a copy-paste error.\n\n**Example:**\n\n\n map.put(\"A\", 1);\n map.put(\"B\", 2);\n map.put(\"C\", 3);\n map.put(\"D\", 4);\n map.put(\"A\", 5); // duplicating key \"A\", overwrites the previously written entry\n\nInspection ID: OverwrittenKey\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverwrittenKey",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousClassMethodCount",
+ "shortDescription": {
+ "text": "Anonymous class with too many methods"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous inner classes whose method count exceeds the specified maximum. Anonymous classes with numerous methods may be difficult to understand and should be promoted to become named inner classes. Use the Method count limit field to specify the maximum allowed number of methods in an anonymous inner class. Inspection ID: AnonymousClassMethodCount",
+ "markdown": "Reports anonymous inner classes whose method count exceeds the specified maximum.\n\nAnonymous classes with numerous methods may be\ndifficult to understand and should be promoted to become named inner classes.\n\nUse the **Method count limit** field to specify the maximum allowed number of methods in an anonymous inner class.\n\nInspection ID: AnonymousClassMethodCount"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AnonymousInnerClassWithTooManyMethods",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 127,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalOfNullableMisuse",
+ "shortDescription": {
+ "text": "Use of Optional.ofNullable with null or not-null argument"
+ },
+ "fullDescription": {
+ "text": "Reports uses of 'Optional.ofNullable()' where always null or always not-null argument is passed. There's no point in using 'Optional.ofNullable()' in this case: either 'Optional.empty()' or 'Optional.of()' should be used to explicitly state the intent of creating an always-empty or always non-empty optional respectively. It's also possible that there's a mistake in 'Optional.ofNullable()' argument, so it should be examined. Example: 'Optional empty = Optional.ofNullable(null); // should be Optional.empty();\nOptional present = Optional.ofNullable(\"value\"); // should be Optional.of(\"value\");' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalOfNullableMisuse",
+ "markdown": "Reports uses of `Optional.ofNullable()` where always null or always not-null argument is passed. There's no point in using `Optional.ofNullable()` in this case: either `Optional.empty()` or `Optional.of()` should be used to explicitly state the intent of creating an always-empty or always non-empty optional respectively. It's also possible that there's a mistake in `Optional.ofNullable()` argument, so it should be examined.\n\n\nExample:\n\n\n Optional empty = Optional.ofNullable(null); // should be Optional.empty();\n Optional present = Optional.ofNullable(\"value\"); // should be Optional.of(\"value\"); \n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalOfNullableMisuse"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalOfNullableMisuse",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CastToIncompatibleInterface",
+ "shortDescription": {
+ "text": "Cast to incompatible type"
+ },
+ "fullDescription": {
+ "text": "Reports type cast expressions where the casted expression has a class/interface type that neither extends/implements the cast class/interface type, nor has subclasses that do. Such a construct is likely erroneous, and will throw a 'java.lang.ClassCastException' at runtime. Example: 'interface A {}\n interface Z {}\n static class C {}\n\n void x(C c) {\n if (c instanceof Z) {\n A a = ((A)c); // cast to incompatible interface 'A'\n }\n }' Inspection ID: CastToIncompatibleInterface",
+ "markdown": "Reports type cast expressions where the casted expression has a class/interface type that neither extends/implements the cast class/interface type, nor has subclasses that do.\n\n\nSuch a construct is likely erroneous, and will\nthrow a `java.lang.ClassCastException` at runtime.\n\n**Example:**\n\n\n interface A {}\n interface Z {}\n static class C {}\n\n void x(C c) {\n if (c instanceof Z) {\n A a = ((A)c); // cast to incompatible interface 'A'\n }\n }\n\nInspection ID: CastToIncompatibleInterface"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CastToIncompatibleInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableConditionalExpression",
+ "shortDescription": {
+ "text": "Simplifiable conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions and suggests simplifying them. Examples: 'condition ? true : foo → condition || foo' 'condition ? false : foo → !condition && foo' 'condition ? foo : !foo → condition == foo' 'condition ? true : false → condition' 'a == b ? b : a → a' 'result != null ? result : null → result' Inspection ID: SimplifiableConditionalExpression",
+ "markdown": "Reports conditional expressions and suggests simplifying them.\n\nExamples:\n\n condition ? true : foo → condition || foo\n\n condition ? false : foo → !condition && foo\n\n condition ? foo : !foo → condition == foo\n\n condition ? true : false → condition\n\n a == b ? b : a → a\n\n result != null ? result : null → result\n\nInspection ID: SimplifiableConditionalExpression"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableConditionalExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnqualifiedMethodAccess",
+ "shortDescription": {
+ "text": "Instance method call not qualified with 'this'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to non-'static' methods on the same instance that are not qualified with 'this'. Example: 'class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }' After the quick-fix is applied: 'class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }' Inspection ID: UnqualifiedMethodAccess",
+ "markdown": "Reports calls to non-`static` methods on the same instance that are not qualified with `this`.\n\n**Example:**\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }\n\nInspection ID: UnqualifiedMethodAccess"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnqualifiedMethodAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceofIncompatibleInterface",
+ "shortDescription": {
+ "text": "'instanceof' with incompatible type"
+ },
+ "fullDescription": {
+ "text": "Reports 'instanceof' expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the 'instanceof' expression, nor has subclasses that do. Although it could be intended for e.g. library code, such a construct is likely erroneous, because no instance of any class declared in the project could pass this 'instanceof' test. Example: 'class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }' Inspection ID: InstanceofIncompatibleInterface",
+ "markdown": "Reports `instanceof` expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the `instanceof` expression, nor has subclasses that do.\n\n\nAlthough it could be intended for e.g. library code, such a construct is likely erroneous,\nbecause no instance of any class declared in the project could pass this `instanceof` test.\n\n**Example:**\n\n\n class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }\n\nInspection ID: InstanceofIncompatibleInterface"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceofIncompatibleInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FunctionalExpressionCanBeFolded",
+ "shortDescription": {
+ "text": "Functional expression can be folded"
+ },
+ "fullDescription": {
+ "text": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation. Example: 'SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());' After the quick-fix is applied: 'SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);' This inspection reports only if the language level of the project or module is 8 or higher. Inspection ID: FunctionalExpressionCanBeFolded",
+ "markdown": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher.\n\nInspection ID: FunctionalExpressionCanBeFolded"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FunctionalExpressionCanBeFolded",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CustomClassloader",
+ "shortDescription": {
+ "text": "Custom 'ClassLoader' is declared"
+ },
+ "fullDescription": {
+ "text": "Reports user-defined subclasses of 'java.lang.ClassLoader'. While not necessarily representing a security hole, such classes should be thoroughly inspected for possible security issues. Inspection ID: CustomClassloader",
+ "markdown": "Reports user-defined subclasses of `java.lang.ClassLoader`.\n\n\nWhile not necessarily representing a security hole, such classes should be thoroughly\ninspected for possible security issues.\n\n\nInspection ID: CustomClassloader"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CustomClassloader",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThisEscapedInConstructor",
+ "shortDescription": {
+ "text": "'this' reference escaped in object construction"
+ },
+ "fullDescription": {
+ "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }' Inspection ID: ThisEscapedInConstructor",
+ "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n\nInspection ID: ThisEscapedInConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThisEscapedInObjectConstruction",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarySuperConstructor",
+ "shortDescription": {
+ "text": "Unnecessary call to 'super()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }' Inspection ID: UnnecessarySuperConstructor",
+ "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n\nInspection ID: UnnecessarySuperConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryCallToSuper",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonPublicClone",
+ "shortDescription": {
+ "text": "'clone()' method not 'public'"
+ },
+ "fullDescription": {
+ "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package. Inspection ID: NonPublicClone",
+ "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package.\n\nInspection ID: NonPublicClone"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonPublicClone",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 117,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IfCanBeSwitch",
+ "shortDescription": {
+ "text": "'if' can be replaced with 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only. Inspection ID: IfCanBeSwitch",
+ "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only.\n\nInspection ID: IfCanBeSwitch"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IfCanBeSwitch",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids",
+ "index": 84,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InfiniteRecursion",
+ "shortDescription": {
+ "text": "Infinite recursion"
+ },
+ "fullDescription": {
+ "text": "Reports methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }' Inspection ID: InfiniteRecursion",
+ "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n\nInspection ID: InfiniteRecursion"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InfiniteRecursion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DeprecatedIsStillUsed",
+ "shortDescription": {
+ "text": "Deprecated member is still used"
+ },
+ "fullDescription": {
+ "text": "Reports deprecated classes, methods, and fields that are used in your code nonetheless. Example: 'class MyCode {\n @Deprecated\n void oldMethod() {}// warning: \"Deprecated member is still used\"\n\n void newMethod() {\n oldMethod(); // forgotten usage\n }\n }' Usages within deprecated elements are ignored. NOTE: Due to performance reasons, a non-private member is checked only when its name rarely occurs in the project. Inspection ID: DeprecatedIsStillUsed",
+ "markdown": "Reports deprecated classes, methods, and fields that are used in your code nonetheless.\n\nExample:\n\n\n class MyCode {\n @Deprecated\n void oldMethod() {}// warning: \"Deprecated member is still used\"\n\n void newMethod() {\n oldMethod(); // forgotten usage\n }\n }\n\nUsages within deprecated elements are ignored.\n\n**NOTE:** Due to performance reasons, a non-private member is checked only when its name rarely occurs in the project.\n\nInspection ID: DeprecatedIsStillUsed"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DeprecatedIsStillUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 58,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantComparatorComparing",
+ "shortDescription": {
+ "text": "Comparator method can be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports 'Comparator' combinator constructs that can be simplified. Example: 'c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());' After the quick-fixes are applied: 'c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());' Inspection ID: RedundantComparatorComparing New in 2018.1",
+ "markdown": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nInspection ID: RedundantComparatorComparing\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantComparatorComparing",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "VariableNotUsedInsideIf",
+ "shortDescription": {
+ "text": "Reference checked for 'null' is not used inside 'if'"
+ },
+ "fullDescription": {
+ "text": "Reports references to variables that are checked for nullability in the condition of an 'if' statement or conditional expression but not used inside that 'if' statement. Usually this either means that the check is unnecessary or that the variable is not referenced inside the 'if' statement by mistake. Example: 'void test(Integer i) {\n if (i != null) { // here 'i' is not used inside 'if' statement\n System.out.println();\n }\n }' Inspection ID: VariableNotUsedInsideIf",
+ "markdown": "Reports references to variables that are checked for nullability in the condition of an `if` statement or conditional expression but not used inside that `if` statement.\n\n\nUsually this either means that\nthe check is unnecessary or that the variable is not referenced inside the\n`if` statement by mistake.\n\n**Example:**\n\n\n void test(Integer i) {\n if (i != null) { // here 'i' is not used inside 'if' statement\n System.out.println();\n }\n }\n\nInspection ID: VariableNotUsedInsideIf"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "VariableNotUsedInsideIf",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CollectionAddAllCanBeReplacedWithConstructor",
+ "shortDescription": {
+ "text": "Redundant 'Collection.addAll()' call"
+ },
+ "fullDescription": {
+ "text": "Reports 'Collection.addAll()' and 'Map.putAll()' calls immediately after an instantiation of a collection using a no-arg constructor. Such constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement might be more performant. Example: 'Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' After the quick-fix is applied: 'Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' The JDK collection classes are supported by default. Additionally, you can specify other classes using the Classes to check panel. Inspection ID: CollectionAddAllCanBeReplacedWithConstructor",
+ "markdown": "Reports `Collection.addAll()` and `Map.putAll()` calls immediately after an instantiation of a collection using a no-arg constructor.\n\nSuch constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement\nmight be more performant.\n\n**Example:**\n\n\n Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\nAfter the quick-fix is applied:\n\n\n Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\n\nThe JDK collection classes are supported by default.\nAdditionally, you can specify other classes using the **Classes to check** panel.\n\nInspection ID: CollectionAddAllCanBeReplacedWithConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CollectionAddAllCanBeReplacedWithConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultipleReturnPointsPerMethod",
+ "shortDescription": {
+ "text": "Method with multiple return points"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose number of 'return' points exceeds the specified maximum. Methods with too many 'return' points may be confusing and hard to refactor. A 'return' point is either a 'return' statement or a falling through the bottom of a 'void' method or constructor. Example: The method below is reported if only two 'return' statements are allowed: 'void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user)) {\n user.setId(getId());\n return;\n } else if (cond2(user)) {\n if (cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n }' Consider rewriting the method so it becomes easier to understand: 'void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user) || cond2(user) && cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }' Configure the inspection: Use the Return point limit field to specify the maximum allowed number of 'return' points for a method. Use the Ignore guard clauses option to ignore guard clauses. A guard clause is an 'if' statement that contains only a 'return' statement Use the Ignore for 'equals()' methods option to ignore 'return' points inside 'equals()' methods. Inspection ID: MultipleReturnPointsPerMethod",
+ "markdown": "Reports methods whose number of `return` points exceeds the specified maximum. Methods with too many `return` points may be confusing and hard to refactor.\n\nA `return` point is either a `return` statement or a falling through the bottom of a\n`void` method or constructor.\n\n**Example:**\n\nThe method below is reported if only two `return` statements are allowed:\n\n\n void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user)) {\n user.setId(getId());\n return;\n } else if (cond2(user)) {\n if (cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n }\n\nConsider rewriting the method so it becomes easier to understand:\n\n\n void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user) || cond2(user) && cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n\nConfigure the inspection:\n\n* Use the **Return point limit** field to specify the maximum allowed number of `return` points for a method.\n* Use the **Ignore guard clauses** option to ignore guard clauses. A guard clause is an `if` statement that contains only a `return` statement\n* Use the **Ignore for 'equals()' methods** option to ignore `return` points inside `equals()` methods.\n\nInspection ID: MultipleReturnPointsPerMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodWithMultipleReturnPoints",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 141,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousMethodCalls",
+ "shortDescription": {
+ "text": "Suspicious collection method call"
+ },
+ "fullDescription": {
+ "text": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type. Example: 'List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted' In the inspection settings, you can disable warnings for potentially correct code like the following: 'public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }' Inspection ID: SuspiciousMethodCalls",
+ "markdown": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type.\n\n**Example:**\n\n\n List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted\n\n\nIn the inspection settings, you can disable warnings for potentially correct code like the following:\n\n\n public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }\n\nInspection ID: SuspiciousMethodCalls"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousMethodCalls",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForwardCompatibility",
+ "shortDescription": {
+ "text": "Forward compatibility"
+ },
+ "fullDescription": {
+ "text": "Reports Java code constructs that may fail to compile in future Java versions. The following problems are reported: Uses of 'assert', 'enum' or '_' as an identifier Uses of the 'var', 'yield', or 'record' restricted identifier as a type name Unqualified calls to methods named 'yield' Modifiers on the 'requires java.base' statement inside of 'module-info.java' Redundant semicolons between import statements Example: '// This previously legal class does not compile with Java 14,\n // as 'yield' became a restricted identifier.\n public class yield {}' Fixing these issues timely may simplify migration to future Java versions. Inspection ID: ForwardCompatibility",
+ "markdown": "Reports Java code constructs that may fail to compile in future Java versions.\n\nThe following problems are reported:\n\n* Uses of `assert`, `enum` or `_` as an identifier\n* Uses of the `var`, `yield`, or `record` restricted identifier as a type name\n* Unqualified calls to methods named `yield`\n* Modifiers on the `requires java.base` statement inside of `module-info.java`\n* Redundant semicolons between import statements\n\n**Example:**\n\n\n // This previously legal class does not compile with Java 14,\n // as 'yield' became a restricted identifier.\n public class yield {} \n\nFixing these issues timely may simplify migration to future Java versions.\n\nInspection ID: ForwardCompatibility"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForwardCompatibility",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 153,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DiamondCanBeReplacedWithExplicitTypeArguments",
+ "shortDescription": {
+ "text": "Diamond can be replaced with explicit type arguments"
+ },
+ "fullDescription": {
+ "text": "Reports instantiation of generic classes in which the <> symbol (diamond) is used instead of type parameters. The quick-fix replaces <> (diamond) with explicit type parameters. Example: 'List list = new ArrayList<>()' After the quick-fix is applied: 'List list = new ArrayList()' Diamond operation appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: DiamondCanBeReplacedWithExplicitTypeArguments",
+ "markdown": "Reports instantiation of generic classes in which the **\\<\\>** symbol (diamond) is used instead of type parameters.\n\nThe quick-fix replaces **\\<\\>** (diamond) with explicit type parameters.\n\nExample:\n\n List list = new ArrayList<>()\n\nAfter the quick-fix is applied:\n\n List list = new ArrayList()\n\n\n*Diamond operation* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: DiamondCanBeReplacedWithExplicitTypeArguments"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "DiamondCanBeReplacedWithExplicitTypeArguments",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfProcessBuilder",
+ "shortDescription": {
+ "text": "Use of 'java.lang.ProcessBuilder' class"
+ },
+ "fullDescription": {
+ "text": "Reports uses of 'java.lang.ProcessBuilder', which might be unportable between operating systems because paths to executables, environment variables, command-line arguments and their escaping might vary depending on the OS. Inspection ID: UseOfProcessBuilder",
+ "markdown": "Reports uses of `java.lang.ProcessBuilder`, which might be unportable between operating systems because paths to executables, environment variables, command-line arguments and their escaping might vary depending on the OS.\n\nInspection ID: UseOfProcessBuilder"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfProcessBuilder",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 93,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaRequiresAutoModule",
+ "shortDescription": {
+ "text": "Dependencies on automatic modules"
+ },
+ "fullDescription": {
+ "text": "Reports usages of automatic modules in a 'requires' directive. An automatic module is unreliable since it can depend on the types on the class path, and its name and exported packages can change if it's converted into an explicit module. Corresponds to '-Xlint:requires-automatic' and '-Xlint:requires-transitive-automatic' Javac options. The first option increases awareness of when automatic modules are used. The second warns the authors of a module that they're putting the users of that module at risk by establishing implied readability to an automatic module. Example: '//module-info.java\n module org.printer {\n requires transitive drivers.corp.org; // reported in case 'drivers.corp.org' is an automatic module\n }' Use the Highlight only transitive dependencies option to warn only about transitive dependencies. This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: JavaRequiresAutoModule",
+ "markdown": "Reports usages of automatic modules in a `requires` directive.\n\nAn automatic\nmodule is unreliable since it can depend on the types on the class path,\nand its name and exported packages can change if it's\nconverted into an explicit module.\n\nCorresponds to `-Xlint:requires-automatic` and `-Xlint:requires-transitive-automatic` Javac options.\nThe first option increases awareness of when automatic modules are used.\nThe second warns the authors of a module that they're putting the users of that module at risk by establishing implied readability to an automatic module.\n\n**Example:**\n\n\n //module-info.java\n module org.printer {\n requires transitive drivers.corp.org; // reported in case 'drivers.corp.org' is an automatic module\n }\n\n\nUse the **Highlight only transitive dependencies** option to warn only about transitive dependencies.\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: JavaRequiresAutoModule"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "requires-transitive-automatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 9",
+ "index": 85,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExcessiveRangeCheck",
+ "shortDescription": {
+ "text": "Excessive range check"
+ },
+ "fullDescription": {
+ "text": "Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check. The quick-fix replaces a condition chain with a simplified expression: Example: 'x > 2 && x < 4' After the quick-fix is applied: 'x == 3' Example: 'arr.length == 0 || arr.length > 1' After the quick-fix is applied: 'arr.length != 1' Inspection ID: ExcessiveRangeCheck New in 2019.1",
+ "markdown": "Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check.\n\nThe quick-fix replaces a condition chain with a simplified expression:\n\nExample:\n\n\n x > 2 && x < 4\n\nAfter the quick-fix is applied:\n\n\n x == 3\n\nExample:\n\n\n arr.length == 0 || arr.length > 1\n\nAfter the quick-fix is applied:\n\n\n arr.length != 1\n\nInspection ID: ExcessiveRangeCheck\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExcessiveRangeCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantJavaTimeOperations",
+ "shortDescription": {
+ "text": "Redundant operation on 'java.time' object"
+ },
+ "fullDescription": {
+ "text": "Reports redundant operation on 'java.time' object redundant: creation of date/time objects from the JDK 'java.time' package when simpler method calls can be used or creation can be avoided. 'java.time' method calls with 'java.time.temporal.ChronoField' and 'java.time.temporal.ChronoUnit' as arguments when these calls can be replaced with calls of more specific methods. 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Examples: - Before: 'LocalDateTime now = LocalDateTime.now();\nreturn LocalDateTime.from(now);' After the quick-fix is applied: 'LocalDateTime now = LocalDateTime.now();\nreturn now;' - Before: 'LocalTime localTime = LocalTime.now();\nint minute = localTime.get(ChronoField.MINUTE_OF_HOUR);' After the quick-fix is applied: 'LocalTime localTime = LocalTime.now();\nint minute = localTime.getMinute();' - Before: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' Inspection ID: RedundantJavaTimeOperations New in 2024.3",
+ "markdown": "Reports redundant operation on 'java.time' object redundant:\n\n* creation of date/time objects from the JDK `java.time` package when simpler method calls can be used or creation can be avoided.\n* `java.time` method calls with `java.time.temporal.ChronoField` and `java.time.temporal.ChronoUnit` as arguments when these calls can be replaced with calls of more specific methods.\n* `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExamples:\n- Before:\n\n\n LocalDateTime now = LocalDateTime.now();\n return LocalDateTime.from(now);\n\nAfter the quick-fix is applied:\n\n\n LocalDateTime now = LocalDateTime.now();\n return now;\n\n- Before:\n\n\n LocalTime localTime = LocalTime.now();\n int minute = localTime.get(ChronoField.MINUTE_OF_HOUR);\n\nAfter the quick-fix is applied:\n\n\n LocalTime localTime = LocalTime.now();\n int minute = localTime.getMinute();\n\n- Before:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nInspection ID: RedundantJavaTimeOperations\n\nNew in 2024.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantJavaTimeOperations",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenation",
+ "shortDescription": {
+ "text": "String concatenation"
+ },
+ "fullDescription": {
+ "text": "Reports 'String' concatenations. Concatenation might be incorrect in an internationalized environment and could be replaced by usages of 'java.text.MessageFormat' or similar classes. Example: 'String getMessage(String string, int number) {\n return string + number;\n }' Inspection ID: StringConcatenation",
+ "markdown": "Reports `String` concatenations. Concatenation might be incorrect in an internationalized environment and could be replaced by usages of `java.text.MessageFormat` or similar classes.\n\n**Example:**\n\n\n String getMessage(String string, int number) {\n return string + number;\n }\n\nInspection ID: StringConcatenation"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 7,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassCanBeRecord",
+ "shortDescription": {
+ "text": "Class can be record class"
+ },
+ "fullDescription": {
+ "text": "Reports classes that can be converted to record classes. Record classes focus on modeling immutable data rather than extensible behavior. Automatic implicit implementation of data-driven methods, such as 'equals()' and accessors, helps to reduce boilerplate code. Note that not every class can be a record class. Here are some restrictions: The class must have no subclasses. All non-static fields in the class must be final. Initializers, generic constructors, and native methods must not be present. For a full description of record classes, refer to the Java Language Specification. Example: 'class Point {\n private final double x;\n private final double y;\n\n Point(double x, double y) {\n this.x = x;\n this.y = y;\n }\n\n double getX() {\n return x;\n }\n\n double getY() {\n return y;\n }\n }' After the quick-fix is applied: 'record Point(int x, int y) {\n }' Enable the Suggest renaming accessor methods option to rename 'getX()'/'isX()' accessors to 'x()' automatically. Use the Disable highlighting if members become more accessible option to exclude classes whose members' accessibility would be weakened by conversion. Quick-fix will stay available as an intention, and triggering it will show the affected members and ask for confirmation. In batch mode conversion will not be suggested. Use the Suppress conversion if the class is annotated by list to exclude classes from conversion when annotated by annotations matching the specified patterns. This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: ClassCanBeRecord New in 2020.3",
+ "markdown": "Reports classes that can be converted to record classes.\n\nRecord classes focus on modeling immutable data rather than extensible behavior.\nAutomatic implicit implementation of data-driven methods, such as `equals()` and accessors, helps to reduce boilerplate code.\n\n\nNote that not every class can be a record class. Here are some restrictions:\n\n* The class must have no subclasses.\n* All non-static fields in the class must be final.\n* Initializers, generic constructors, and native methods must not be present.\n\nFor a full description of record classes, refer to the\n[Java Language Specification](https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.10).\n\nExample:\n\n\n class Point {\n private final double x;\n private final double y;\n\n Point(double x, double y) {\n this.x = x;\n this.y = y;\n }\n\n double getX() {\n return x;\n }\n\n double getY() {\n return y;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n record Point(int x, int y) {\n }\n\nEnable the **Suggest renaming accessor methods** option to rename `getX()`/`isX()` accessors to `x()` automatically.\n\n\nUse the **Disable highlighting if members become more accessible** option to exclude classes whose members'\naccessibility would be weakened by conversion.\nQuick-fix will stay available as an intention, and triggering it will show the affected members and ask for confirmation.\nIn batch mode conversion will not be suggested.\n\nUse the **Suppress conversion if the class is annotated by** list to exclude classes from conversion when annotated by annotations matching the specified patterns.\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: ClassCanBeRecord\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ClassCanBeRecord",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 16",
+ "index": 201,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantAssertArgument",
+ "shortDescription": {
+ "text": "Constant assert argument"
+ },
+ "fullDescription": {
+ "text": "Reports constant arguments in 'assertTrue()', 'assertFalse()', 'assertNull()', and 'assertNotNull()' calls. Calls to these methods with constant arguments will either always succeed or always fail. Such statements can easily be left over after refactoring and are probably not intended. Example: 'assertNotNull(\"foo\");' Inspection ID: ConstantAssertArgument",
+ "markdown": "Reports constant arguments in `assertTrue()`, `assertFalse()`, `assertNull()`, and `assertNotNull()` calls.\n\n\nCalls to these methods with\nconstant arguments will either always succeed or always fail.\nSuch statements can easily be left over after refactoring and are probably not intended.\n\n**Example:**\n\n\n assertNotNull(\"foo\");\n\nInspection ID: ConstantAssertArgument"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantAssertArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 133,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RuntimeExec",
+ "shortDescription": {
+ "text": "Call to 'Runtime.exec()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Runtime.exec()' or any of its variants. Calls to 'Runtime.exec()' are inherently unportable. Inspection ID: RuntimeExec",
+ "markdown": "Reports calls to `Runtime.exec()` or any of its variants. Calls to `Runtime.exec()` are inherently unportable.\n\nInspection ID: RuntimeExec"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToRuntimeExec",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 93,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticInitializerReferencesSubClass",
+ "shortDescription": {
+ "text": "Static initializer references subclass"
+ },
+ "fullDescription": {
+ "text": "Reports classes that refer to their subclasses in static initializers or static fields. Such references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass and another thread tries to load the subclass at the same time. Example: 'class Parent {\n static final Child field = new Child();\n }\n class Child extends Parent { }' Inspection ID: StaticInitializerReferencesSubClass",
+ "markdown": "Reports classes that refer to their subclasses in static initializers or static fields.\n\nSuch references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass\nand another thread tries to load the subclass at the same time.\n\n**Example:**\n\n\n class Parent {\n static final Child field = new Child();\n }\n class Child extends Parent { }\n\nInspection ID: StaticInitializerReferencesSubClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticInitializerReferencesSubClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingDeprecatedAnnotationOnScheduledForRemovalApi",
+ "shortDescription": {
+ "text": "Missing '@Deprecated' annotation on scheduled for removal API"
+ },
+ "fullDescription": {
+ "text": "Reports declarations marked with '@ApiStatus.ScheduledForRemoval' without '@Deprecated'. Example: '@ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }' After the quick-fix is applied the result looks like: '@Deprecated\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }' Inspection ID: MissingDeprecatedAnnotationOnScheduledForRemovalApi",
+ "markdown": "Reports declarations marked with `@ApiStatus.ScheduledForRemoval` without `@Deprecated`.\n\nExample:\n\n\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }\n\nAfter the quick-fix is applied the result looks like:\n\n\n @Deprecated\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }\n\nInspection ID: MissingDeprecatedAnnotationOnScheduledForRemovalApi"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "MissingDeprecatedAnnotationOnScheduledForRemovalApi",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical",
+ "codeQualityCategory": "Code Style"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantDeclaredInAbstractClass",
+ "shortDescription": {
+ "text": "Constant declared in 'abstract' class"
+ },
+ "fullDescription": {
+ "text": "Reports constants ('public static final' fields) declared in abstract classes. Some coding standards require declaring constants in interfaces instead. Inspection ID: ConstantDeclaredInAbstractClass",
+ "markdown": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead.\n\nInspection ID: ConstantDeclaredInAbstractClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantDeclaredInAbstractClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SubtractionInCompareTo",
+ "shortDescription": {
+ "text": "Subtraction in 'compareTo()'"
+ },
+ "fullDescription": {
+ "text": "Reports subtraction in 'compareTo()' methods and methods implementing 'java.util.Comparator.compare()'. While it is a common idiom to use the results of integer subtraction as the result of a 'compareTo()' method, this construct may cause subtle and difficult bugs in cases of integer overflow. Comparing the integer values directly and returning '-1', '0', or '1' is a better practice in most cases. Subtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to rounding. The inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs. Additionally, subtraction on 'int' numbers greater than or equal to '0' will never overflow. Therefore, this inspection tries not to warn in those cases. Methods that always return zero or greater can be marked with the 'javax.annotation.Nonnegative' annotation or specified in this inspection's options. Example: 'class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }' A no-warning example because 'String.length()' is known to be non-negative: 'class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }' Use the options to list methods that are safe to use inside a subtraction. Methods are safe when they return an 'int' value that is always greater than or equal to '0'. Inspection ID: SubtractionInCompareTo",
+ "markdown": "Reports subtraction in `compareTo()` methods and methods implementing `java.util.Comparator.compare()`.\n\n\nWhile it is a common idiom to\nuse the results of integer subtraction as the result of a `compareTo()`\nmethod, this construct may cause subtle and difficult bugs in cases of integer overflow.\nComparing the integer values directly and returning `-1`, `0`, or `1` is a better practice in most cases.\n\n\nSubtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to\nrounding.\n\n\nThe inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs.\nAdditionally, subtraction on `int` numbers greater than or equal to `0` will never overflow.\nTherefore, this inspection tries not to warn in those cases.\n\n\nMethods that always return zero or greater can be marked with the\n`javax.annotation.Nonnegative` annotation or specified in this inspection's options.\n\n**Example:**\n\n\n class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }\n\nA no-warning example because `String.length()` is known to be non-negative:\n\n\n class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }\n\n\nUse the options to list methods that are safe to use inside a subtraction.\nMethods are safe when they return an `int` value that is always greater than or equal to `0`.\n\nInspection ID: SubtractionInCompareTo"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SubtractionInCompareTo",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConnectionResource",
+ "shortDescription": {
+ "text": "Connection opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports Java ME 'javax.microedition.io.Connection' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. Example: 'void example() throws IOException {\n Connection c = Connector.open(\"foo\");\n }' Inspection ID: ConnectionResource",
+ "markdown": "Reports Java ME `javax.microedition.io.Connection` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n**Example:**\n\n\n void example() throws IOException {\n Connection c = Connector.open(\"foo\");\n }\n\nInspection ID: ConnectionResource"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConnectionOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 181,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanVariableAlwaysNegated",
+ "shortDescription": {
+ "text": "Boolean variable is always inverted"
+ },
+ "fullDescription": {
+ "text": "Reports boolean variables or fields which are always negated when their value is used. Example: 'void m() {\n boolean b = true; //boolean variable 'b' is always inverted\n System.out.println(!b);\n }' Inspection ID: BooleanVariableAlwaysNegated",
+ "markdown": "Reports boolean variables or fields which are always negated when their value is used.\n\nExample:\n\n\n void m() {\n boolean b = true; //boolean variable 'b' is always inverted\n System.out.println(!b);\n }\n\nInspection ID: BooleanVariableAlwaysNegated"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanVariableAlwaysNegated",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 65,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsAnnotation",
+ "shortDescription": {
+ "text": "Class extends annotation interface"
+ },
+ "fullDescription": {
+ "text": "Reports classes declared as an implementation or extension of an annotation interface. While it is legal to extend an annotation interface, it is often done by accident, and the result can't be used as an annotation. This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: ExtendsAnnotation",
+ "markdown": "Reports classes declared as an implementation or extension of an annotation interface.\n\nWhile it is legal to extend an annotation interface, it is often done by accident,\nand the result can't be used as an annotation.\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: ExtendsAnnotation"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassExplicitlyAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "unused",
+ "shortDescription": {
+ "text": "Unused declaration"
+ },
+ "fullDescription": {
+ "text": "Reports classes, methods, or fields that are not used or unreachable from the entry points. An entry point can be a main method, tests, classes from outside the specified scope, classes accessible from 'module-info.java', and so on. It is possible to configure custom entry points by using name patterns or annotations. Example: 'public class Department {\n private Organization myOrganization;\n }' In this example, 'Department' explicitly references 'Organization' but if 'Department' class itself is unused, then inspection will report both classes. The inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local variables that are declared but not used. Note: Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is checked only when its name rarely occurs in the project. To see all results, run the inspection by selecting Code | Inspect Code or Code | Analyze Code | Run Inspection by Name from the main menu. Use the visibility settings below to configure members to be reported. For example, configuring report 'private' methods only means that 'public' methods of 'private' inner class will be reported but 'protected' methods of top level class will be ignored. Use the entry points tab to configure entry points to be considered during the inspection run. You can add entry points manually when inspection results are ready. If your code uses unsupported frameworks, there are several options: If the framework relies on annotations, use the Annotations... button to configure the framework's annotations. If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework. This way the annotated code accessible by the framework internals will be treated as used. Inspection ID: unused",
+ "markdown": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used.\n\nInspection ID: unused"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "unused",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousGetterSetter",
+ "shortDescription": {
+ "text": "Suspicious getter/setter"
+ },
+ "fullDescription": {
+ "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter. Inspection ID: SuspiciousGetterSetter",
+ "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.\n\n\nInspection ID: SuspiciousGetterSetter"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousGetterSetter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 147,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MismatchedStringCase",
+ "shortDescription": {
+ "text": "Mismatched case in 'String' operation"
+ },
+ "fullDescription": {
+ "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n Inspection ID: MismatchedStringCase New in 2019.3",
+ "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nInspection ID: MismatchedStringCase\n\nNew in 2019.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MismatchedStringCase",
+ "cweIds": [
+ 597
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Reliability"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToNull",
+ "shortDescription": {
+ "text": "'null' assignment"
+ },
+ "fullDescription": {
+ "text": "Reports variables that are assigned to 'null' outside a declaration. The main purpose of 'null' in Java is to denote uninitialized reference variables. In rare cases, assigning a variable explicitly to 'null' is useful to aid garbage collection. However, using 'null' to denote a missing, not specified, or invalid value or a not found element is considered bad practice and may make your code more prone to 'NullPointerExceptions'. Instead, consider defining a sentinel object with the intended semantics or use library types like 'Optional' to denote the absence of a value. Example: 'Integer convert(String s) {\n Integer value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n // Warning: null is used to denote an 'invalid value'\n value = null;\n }\n return value;\n }' Use the Ignore assignments to fields option to ignore assignments to fields. Inspection ID: AssignmentToNull",
+ "markdown": "Reports variables that are assigned to `null` outside a declaration.\n\nThe main purpose of `null` in Java is to denote uninitialized\nreference variables. In rare cases, assigning a variable explicitly to `null`\nis useful to aid garbage collection. However, using `null` to denote a missing, not specified, or invalid value or a not\nfound element is considered bad practice and may make your code more prone to `NullPointerExceptions`.\nInstead, consider defining a sentinel object with the intended semantics\nor use library types like `Optional` to denote the absence of a value.\n\n**Example:**\n\n\n Integer convert(String s) {\n Integer value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n // Warning: null is used to denote an 'invalid value'\n value = null;\n }\n return value;\n }\n\n\nUse the **Ignore assignments to fields** option to ignore assignments to fields.\n\nInspection ID: AssignmentToNull"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToNull",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 83,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitCalledOnCondition",
+ "shortDescription": {
+ "text": "'wait()' called on 'java.util.concurrent.locks.Condition' object"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()' made on a 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'await()' method was intended instead. Example: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }' Good code would look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }' Inspection ID: WaitCalledOnCondition",
+ "markdown": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n\nInspection ID: WaitCalledOnCondition"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitCalledOnCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonSynchronizedMethodOverridesSynchronizedMethod",
+ "shortDescription": {
+ "text": "Unsynchronized method overrides 'synchronized' method"
+ },
+ "fullDescription": {
+ "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }' Inspection ID: NonSynchronizedMethodOverridesSynchronizedMethod",
+ "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n\nInspection ID: NonSynchronizedMethodOverridesSynchronizedMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonSynchronizedMethodOverridesSynchronizedMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TooBroadCatch",
+ "shortDescription": {
+ "text": "Overly broad 'catch' block"
+ },
+ "fullDescription": {
+ "text": "Reports 'catch' blocks with parameters that are more generic than the exception thrown by the corresponding 'try' block. Example: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }' After the quick-fix is applied: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }' Configure the inspection: Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad. Inspection ID: TooBroadCatch",
+ "markdown": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad.\n\nInspection ID: TooBroadCatch"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyBroadCatchBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ProtectedMemberInFinalClass",
+ "shortDescription": {
+ "text": "'protected' member in 'final' class"
+ },
+ "fullDescription": {
+ "text": "Reports 'protected' members in 'final' classes with no 'protected' modifier. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly. Inspection ID: ProtectedMemberInFinalClass",
+ "markdown": "Reports `protected` members in `final` classes with no `protected` modifier.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly.\n\n\nInspection ID: ProtectedMemberInFinalClass"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProtectedMemberInFinalClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DanglingJavadoc",
+ "shortDescription": {
+ "text": "Dangling Javadoc comment"
+ },
+ "fullDescription": {
+ "text": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates. Example: 'class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' A quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied: 'class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' Use the Ignore file header comment in JavaDoc format option to ignore comments at the beginning of Java files. These are usually copyright messages. Inspection ID: DanglingJavadoc",
+ "markdown": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates.\n\n**Example:**\n\n\n class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nA quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied:\n\n\n class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nUse the **Ignore file header comment in JavaDoc format** option to ignore comments at the beginning of Java files.\nThese are usually copyright messages.\n\nInspection ID: DanglingJavadoc"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DanglingJavadoc",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "HibernateResource",
+ "shortDescription": {
+ "text": "Hibernate resource opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports calls to the 'openSession()' method if the returned 'org.hibernate.Session' resource is not safely closed. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void doHibernateQuery(SessionFactory factory) {\n Session session = factory.openSession(); //warning\n session.createQuery(\"...\");\n }' Use the following options to configure the inspection: Whether a 'org.hibernate.Session' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: HibernateResource",
+ "markdown": "Reports calls to the `openSession()` method if the returned `org.hibernate.Session` resource is not safely closed.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void doHibernateQuery(SessionFactory factory) {\n Session session = factory.openSession(); //warning\n session.createQuery(\"...\");\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `org.hibernate.Session` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: HibernateResource"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "HibernateResourceOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 142,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryInitCause",
+ "shortDescription": {
+ "text": "Unnecessary call to 'Throwable.initCause()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Throwable.initCause()' where an exception constructor also takes a 'Throwable cause' argument. In this case, the 'initCause()' call can be removed and its argument can be added to the call to the exception's constructor. Example: 'try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }' A quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied: 'try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }' Inspection ID: UnnecessaryInitCause",
+ "markdown": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \nInspection ID: UnnecessaryInitCause"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryInitCause",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparisonOfShortAndChar",
+ "shortDescription": {
+ "text": "Comparison of 'short' and 'char' values"
+ },
+ "fullDescription": {
+ "text": "Reports equality comparisons between 'short' and 'char' values. Such comparisons may cause subtle bugs because while both values are 2-byte long, 'short' values are signed, and 'char' values are unsigned. Example: 'if (Character.MAX_VALUE == shortValue()) {} //never can be true' Inspection ID: ComparisonOfShortAndChar",
+ "markdown": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n\nInspection ID: ComparisonOfShortAndChar"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparisonOfShortAndChar",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayCanBeReplacedWithEnumValues",
+ "shortDescription": {
+ "text": "Array can be replaced with enum values"
+ },
+ "fullDescription": {
+ "text": "Reports arrays of enum constants that can be replaced with a call to 'EnumType.values()'. Usually, when updating such an enum, you have to update the array as well. However, if you use 'EnumType.values()' instead, no modifications are required. Example: 'enum States {\n NOT_RUN, IN_PROGRESS, FINISHED;\n }\n \n handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});' After the quick-fix is applied: 'handleStates(States.values());' Inspection ID: ArrayCanBeReplacedWithEnumValues New in 2019.1",
+ "markdown": "Reports arrays of enum constants that can be replaced with a call to `EnumType.values()`.\n\nUsually, when updating such an enum, you have to update the array as well. However, if you use `EnumType.values()`\ninstead, no modifications are required.\n\nExample:\n\n\n enum States {\n NOT_RUN, IN_PROGRESS, FINISHED;\n }\n \n handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});\n\nAfter the quick-fix is applied:\n\n\n handleStates(States.values());\n\nInspection ID: ArrayCanBeReplacedWithEnumValues\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ArrayCanBeReplacedWithEnumValues",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitNotifyNotInSynchronizedContext",
+ "shortDescription": {
+ "text": "'wait()' or 'notify()' is not in synchronized context"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()', 'notify()', and 'notifyAll()' that are not made inside a corresponding synchronized statement or synchronized method. Calling these methods on an object without holding a lock on that object causes 'IllegalMonitorStateException'. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but it's worth looking at. Example: 'class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }' Inspection ID: WaitNotifyNotInSynchronizedContext",
+ "markdown": "Reports calls to `wait()`, `notify()`, and `notifyAll()` that are not made inside a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object causes `IllegalMonitorStateException`.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at.\n\n**Example:**\n\n\n class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }\n\nInspection ID: WaitNotifyNotInSynchronizedContext"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitNotifyWhileNotSynced",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DollarSignInName",
+ "shortDescription": {
+ "text": "Use of '$' in identifier"
+ },
+ "fullDescription": {
+ "text": "Reports variables, methods, and classes with dollar signs ('$') in their names. While such names are legal Java, their use outside of generated java code is strongly discouraged. Example: 'class SalaryIn${}' Rename quick-fix is suggested only in the editor. Inspection ID: DollarSignInName",
+ "markdown": "Reports variables, methods, and classes with dollar signs (`$`) in their names. While such names are legal Java, their use outside of generated java code is strongly discouraged.\n\n**Example:**\n\n\n class SalaryIn${}\n\nRename quick-fix is suggested only in the editor.\n\nInspection ID: DollarSignInName"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DollarSignInName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DynamicRegexReplaceableByCompiledPattern",
+ "shortDescription": {
+ "text": "Dynamic regular expression can be replaced by compiled 'Pattern'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to the regular expression methods (such as 'matches()' or 'split()') of 'java.lang.String' using constant arguments. Such calls may be profitably replaced with a 'private static final Pattern' field so that the regular expression does not have to be compiled each time it is used. Example: 'text.replaceAll(\"abc\", replacement);' After the quick-fix is applied: 'private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));' Inspection ID: DynamicRegexReplaceableByCompiledPattern",
+ "markdown": "Reports calls to the regular expression methods (such as `matches()` or `split()`) of `java.lang.String` using constant arguments.\n\n\nSuch calls may be profitably replaced with a `private static final Pattern` field\nso that the regular expression does not have to be compiled each time it is used.\n\n**Example:**\n\n\n text.replaceAll(\"abc\", replacement);\n\nAfter the quick-fix is applied:\n\n\n private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));\n\nInspection ID: DynamicRegexReplaceableByCompiledPattern"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DynamicRegexReplaceableByCompiledPattern",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyInitializer",
+ "shortDescription": {
+ "text": "Empty class initializer"
+ },
+ "fullDescription": {
+ "text": "Reports empty class initializer blocks. Inspection ID: EmptyInitializer",
+ "markdown": "Reports empty class initializer blocks.\n\n\nInspection ID: EmptyInitializer"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptyClassInitializer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryBreak",
+ "shortDescription": {
+ "text": "Unnecessary 'break' statement"
+ },
+ "fullDescription": {
+ "text": "Reports any unnecessary 'break' statements. An 'break' statement is unnecessary if no other statements are executed after it has been removed. Example: 'switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }' Inspection ID: UnnecessaryBreak",
+ "markdown": "Reports any unnecessary `break` statements.\n\nAn `break` statement is unnecessary if no other statements are executed after it has been removed.\n\n**Example:**\n\n\n switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }\n\nInspection ID: UnnecessaryBreak"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryBreak",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RawUseOfParameterizedType",
+ "shortDescription": {
+ "text": "Raw use of parameterized class"
+ },
+ "fullDescription": {
+ "text": "Reports generic classes with omitted type parameters. Such raw use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs. This inspection mirrors the 'rawtypes' warning of 'javac'. Examples: '//warning: Raw use of parameterized class 'List'\nList list = new ArrayList();\n//list of strings was created but integer is accepted as well\nlist.add(1);' '//no warning as it's impossible to provide type arguments during array creation\nIntFunction[]> fun = List[]::new;' Configure the inspection: Use the Ignore construction of new objects option to ignore raw types used in object construction. Use the Ignore type casts option to ignore raw types used in type casts. Use the Ignore where a type parameter would not compile option to ignore the cases when a type parameter fails to compile (for example, when creating an array or overriding a library method). Use the Ignore parameter types of overriding methods option to ignore type parameters used in parameters of overridden methods. Use the Ignore when automatic quick-fix is not available option to ignore the cases when a quick-fix is not available. This inspection depends on the Java feature 'Generics', which is available since Java 5. Inspection ID: RawUseOfParameterizedType",
+ "markdown": "Reports generic classes with omitted type parameters. Such *raw* use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs. This inspection mirrors the `rawtypes` warning of `javac`.\n\n**Examples:**\n\n\n //warning: Raw use of parameterized class 'List'\n List list = new ArrayList();\n //list of strings was created but integer is accepted as well\n list.add(1);\n\n\n //no warning as it's impossible to provide type arguments during array creation\n IntFunction[]> fun = List[]::new;\n\nConfigure the inspection:\n\n* Use the **Ignore construction of new objects** option to ignore raw types used in object construction.\n* Use the **Ignore type casts** option to ignore raw types used in type casts.\n* Use the **Ignore where a type parameter would not compile** option to ignore the cases when a type parameter fails to compile (for example, when creating an array or overriding a library method).\n* Use the **Ignore parameter types of overriding methods** option to ignore type parameters used in parameters of overridden methods.\n* Use the **Ignore when automatic quick-fix is not available** option to ignore the cases when a quick-fix is not available.\n\nThis inspection depends on the Java feature 'Generics', which is available since Java 5.\n\nInspection ID: RawUseOfParameterizedType"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "rawtypes",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicConstructorInNonPublicClass",
+ "shortDescription": {
+ "text": "'public' constructor in non-public class"
+ },
+ "fullDescription": {
+ "text": "Reports 'public' constructors in non-'public' classes. Usually, there is no reason for creating a 'public' constructor in a class with a lower access level. Please note, however, that this inspection changes the behavior of some reflection calls. In particular, 'Class.getConstructor()' won't be able to find the updated constructor ('Class.getDeclaredConstructor()' should be used instead). Do not use the inspection if your code or code of some used frameworks relies on constructor accessibility via 'getConstructor()'. Example: 'class House {\n public House() {}\n }' After the quick-fix is applied: 'class House {\n House() {}\n }' Inspection ID: PublicConstructorInNonPublicClass",
+ "markdown": "Reports `public` constructors in non-`public` classes.\n\nUsually, there is no reason for creating a `public` constructor in a class with a lower access level.\nPlease note, however, that this inspection changes the behavior of some reflection calls. In particular,\n`Class.getConstructor()` won't be able to find the updated constructor\n(`Class.getDeclaredConstructor()` should be used instead). Do not use the inspection if your code\nor code of some used frameworks relies on constructor accessibility via `getConstructor()`.\n\n**Example:**\n\n\n class House {\n public House() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class House {\n House() {}\n }\n\nInspection ID: PublicConstructorInNonPublicClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicConstructorInNonPublicClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ProtectedInnerClass",
+ "shortDescription": {
+ "text": "Protected nested class"
+ },
+ "fullDescription": {
+ "text": "Reports 'protected' nested classes. Example: 'public class Outer {\n protected static class Nested {} // warning\n protected class Inner {} // warning\n protected enum Mode {} // warning depends on the setting\n protected interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore 'protected' inner enums option to ignore 'protected' inner enums. Use the Ignore 'protected' inner interfaces option to ignore 'protected' inner interfaces. Inspection ID: ProtectedInnerClass",
+ "markdown": "Reports `protected` nested classes.\n\n**Example:**\n\n\n public class Outer {\n protected static class Nested {} // warning\n protected class Inner {} // warning\n protected enum Mode {} // warning depends on the setting\n protected interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore 'protected' inner enums** option to ignore `protected` inner enums.\n* Use the **Ignore 'protected' inner interfaces** option to ignore `protected` inner interfaces.\n\nInspection ID: ProtectedInnerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProtectedInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 131,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnqualifiedStaticUsage",
+ "shortDescription": {
+ "text": "Unqualified static access"
+ },
+ "fullDescription": {
+ "text": "Reports usage of static members that is not qualified with the class name. This is legal if the static member is in the same class, but may be confusing. Example: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }' After the quick-fix is applied: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }' Use the inspection settings to toggle the reporting for the following items: static fields access 'void bar() { System.out.println(x); }' calls to static methods 'void bar() { foo(); }' 'static void baz() { foo(); }' You can also configure the inspection to only report static member usage from a non-static context. In the above example, 'static void baz() { foo(); }' will not be reported. Inspection ID: UnqualifiedStaticUsage",
+ "markdown": "Reports usage of static members that is not qualified with the class name.\n\n\nThis is legal if the static member is in\nthe same class, but may be confusing.\n\n**Example:**\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }\n\nUse the inspection settings to toggle the reporting for the following items:\n\n*\n static fields access \n\n `void bar() { System.out.println(x); }`\n\n*\n calls to static methods \n\n `void bar() { foo(); }` \n\n `static void baz() { foo(); }`\n\n\nYou can also configure the inspection to only report static member usage from a non-static context.\nIn the above example, `static void baz() { foo(); }` will not be reported.\n\nInspection ID: UnqualifiedStaticUsage"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnqualifiedStaticUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExternalizableWithoutPublicNoArgConstructor",
+ "shortDescription": {
+ "text": "'Externalizable' class without 'public' no-arg constructor"
+ },
+ "fullDescription": {
+ "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime. Inspection ID: ExternalizableWithoutPublicNoArgConstructor",
+ "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime.\n\nInspection ID: ExternalizableWithoutPublicNoArgConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticGuardedByInstance",
+ "shortDescription": {
+ "text": "Static member guarded by instance field or this"
+ },
+ "fullDescription": {
+ "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: StaticGuardedByInstance",
+ "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: StaticGuardedByInstance"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticGuardedByInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 100,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ManualArrayCopy",
+ "shortDescription": {
+ "text": "Manual array copy"
+ },
+ "fullDescription": {
+ "text": "Reports manual copying of array contents that can be replaced with a call to 'System.arraycopy()'. Example: 'for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }' After the quick-fix is applied: 'System.arraycopy(array, 0, newArray, 0, array.length);' Inspection ID: ManualArrayCopy",
+ "markdown": "Reports manual copying of array contents that can be replaced with a call to `System.arraycopy()`.\n\n**Example:**\n\n\n for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }\n\nAfter the quick-fix is applied:\n\n\n System.arraycopy(array, 0, newArray, 0, array.length);\n\nInspection ID: ManualArrayCopy"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ManualArrayCopy",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticPseudoFunctionalStyleMethod",
+ "shortDescription": {
+ "text": "Guava pseudo-functional call can be converted to Stream API call"
+ },
+ "fullDescription": {
+ "text": "Reports usages of Guava pseudo-functional code when 'Java Stream API' is available. Though 'Guava Iterable API' provides functionality similar to 'Java Streams API', it's slightly different and may miss some features. Especially, primitive-specialized stream variants like 'IntStream' are more performant than generic variants. Example: 'List transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code' After the quick-fix is applied: 'List transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());' Note: Code semantics can be changed; for example, Guava's 'Iterable.transform' produces a lazy-evaluated iterable, but the replacement is eager-evaluated. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: StaticPseudoFunctionalStyleMethod",
+ "markdown": "Reports usages of Guava pseudo-functional code when `Java Stream API` is available.\n\nThough `Guava Iterable API` provides functionality similar to `Java Streams API`, it's slightly different and\nmay miss some features.\nEspecially, primitive-specialized stream variants like `IntStream` are more performant than generic variants.\n\n**Example:**\n\n\n List transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code\n\nAfter the quick-fix is applied:\n\n List transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());\n\n\n**Note:** Code semantics can be changed; for example, Guava's `Iterable.transform` produces a lazy-evaluated iterable,\nbut the replacement is eager-evaluated.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: StaticPseudoFunctionalStyleMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticPseudoFunctionalStyleMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ControlFlowStatementWithoutBraces",
+ "shortDescription": {
+ "text": "Control flow statement without braces"
+ },
+ "fullDescription": {
+ "text": "Reports any 'if', 'while', 'do', or 'for' statements without braces. Some code styles, e.g. the Google Java Style guide, require braces for all control statements. When adding further statements to control statements without braces, it is important not to forget adding braces. When commenting out a line of code, it is also necessary to be more careful when not using braces, to not inadvertently make the next statement part of the control flow statement. Always using braces makes inserting or commenting out a line of code safer. It's likely the goto fail vulnerability would not have happened, if an always use braces code style was used. Control statements with braces make the control flow easier to see, without relying on, possibly incorrect, indentation. Example: 'class Strange {\n void x(boolean one, boolean two) {\n if(one)\n if(two)\n foo();\n else\n bar();\n }\n\n void foo() {}\n void bar() {}\n }' The quick-fix wraps the statement body with braces: 'class Strange {\n void x(boolean one, boolean two) {\n if(one) {\n if(two) {\n foo();\n } else {\n bar();\n }\n }\n }\n\n void foo() {}\n void bar() {}\n }' Inspection ID: ControlFlowStatementWithoutBraces",
+ "markdown": "Reports any `if`, `while`, `do`, or `for` statements without braces. Some code styles, e.g. the [Google Java Style guide](https://google.github.io/styleguide/javaguide.html), require braces for all control statements.\n\n\nWhen adding further statements to control statements without braces, it is important not to forget adding braces.\nWhen commenting out a line of code, it is also necessary to be more careful when not using braces,\nto not inadvertently make the next statement part of the control flow statement.\nAlways using braces makes inserting or commenting out a line of code safer.\n\n\nIt's likely the [goto fail vulnerability](https://www.imperialviolet.org/2014/02/22/applebug.html) would not have happened,\nif an always use braces code style was used.\nControl statements with braces make the control flow easier to see, without relying on, possibly incorrect, indentation.\n\nExample:\n\n\n class Strange {\n void x(boolean one, boolean two) {\n if(one)\n if(two)\n foo();\n else\n bar();\n }\n\n void foo() {}\n void bar() {}\n }\n\nThe quick-fix wraps the statement body with braces:\n\n\n class Strange {\n void x(boolean one, boolean two) {\n if(one) {\n if(two) {\n foo();\n } else {\n bar();\n }\n }\n }\n\n void foo() {}\n void bar() {}\n }\n\nInspection ID: ControlFlowStatementWithoutBraces"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ControlFlowStatementWithoutBraces",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LengthOneStringInIndexOf",
+ "shortDescription": {
+ "text": "Single character string argument in 'String.indexOf()' call"
+ },
+ "fullDescription": {
+ "text": "Reports single character strings being used as an argument in 'String.indexOf()' and 'String.lastIndexOf()' calls. A quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement. Example: 'return s.indexOf(\"x\");' After the quick-fix is applied: 'return s.indexOf('x');' Inspection ID: LengthOneStringInIndexOf",
+ "markdown": "Reports single character strings being used as an argument in `String.indexOf()` and `String.lastIndexOf()` calls.\n\nA quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n return s.indexOf(\"x\");\n\nAfter the quick-fix is applied:\n\n\n return s.indexOf('x');\n\nInspection ID: LengthOneStringInIndexOf"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SingleCharacterStringConcatenation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalFieldInEnum",
+ "shortDescription": {
+ "text": "Non-final field in 'enum'"
+ },
+ "fullDescription": {
+ "text": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable. Example: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' After the quick-fix is applied: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' Use the `Ignore fields that cannot be made 'final'` option to only warn on fields that can be made final using the quick-fix. Inspection ID: NonFinalFieldInEnum",
+ "markdown": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable.\n\n**Example:**\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nUse the \\`Ignore fields that cannot be made 'final'\\` option to only warn on fields that can be made final using the quick-fix.\n\nInspection ID: NonFinalFieldInEnum"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalFieldInEnum",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisspelledEquals",
+ "shortDescription": {
+ "text": "'equal()' instead of 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports declarations of 'equal()' with a single parameter. Normally, this is a typo and 'equals()' is actually intended. A quick-fix is suggested to rename the method to 'equals'. Example: 'class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }' After the quick-fix is applied: 'class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }' Inspection ID: MisspelledEquals",
+ "markdown": "Reports declarations of `equal()` with a single parameter. Normally, this is a typo and `equals()` is actually intended.\n\nA quick-fix is suggested to rename the method to `equals`.\n\n**Example:**\n\n\n class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }\n\nInspection ID: MisspelledEquals"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MisspelledEquals",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TrivialFunctionalExpressionUsage",
+ "shortDescription": {
+ "text": "Trivial usage of functional expression"
+ },
+ "fullDescription": {
+ "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }' Inspection ID: TrivialFunctionalExpressionUsage",
+ "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n\nInspection ID: TrivialFunctionalExpressionUsage"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TrivialFunctionalExpressionUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnumClass",
+ "shortDescription": {
+ "text": "Enumerated class"
+ },
+ "fullDescription": {
+ "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM. Inspection ID: EnumClass",
+ "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM.\n\n\nInspection ID: EnumClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EnumClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 153,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousHasLambdaAlternative",
+ "shortDescription": {
+ "text": "Anonymous type has shorter lambda alternative"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument. The following classes are reported by this inspection: Anonymous classes extending 'ThreadLocal' which have an 'initialValue()' method (can be replaced with 'ThreadLocal.withInitial') Anonymous classes extending 'Thread' which have a 'run()' method (can be replaced with 'new Thread(Runnable)' Example: 'new Thread() {\n @Override\n public void run() {\n System.out.println(\"Hello from thread!\");\n }\n }.start();' After the quick-fix is applied: 'new Thread(() -> {\n System.out.println(\"Hello from thread!\");\n }).start();' This inspection depends on the Java feature 'ThreadLocal.withInitial()', which is available since Java 8. Inspection ID: AnonymousHasLambdaAlternative",
+ "markdown": "Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument.\n\nThe following classes are reported by this inspection:\n\n* Anonymous classes extending `ThreadLocal` which have an `initialValue()` method (can be replaced with `ThreadLocal.withInitial`)\n* Anonymous classes extending `Thread` which have a `run()` method (can be replaced with `new Thread(Runnable)`\n\nExample:\n\n\n new Thread() {\n @Override\n public void run() {\n System.out.println(\"Hello from thread!\");\n }\n }.start();\n\nAfter the quick-fix is applied:\n\n\n new Thread(() -> {\n System.out.println(\"Hello from thread!\");\n }).start();\n\nThis inspection depends on the Java feature 'ThreadLocal.withInitial()', which is available since Java 8.\n\nInspection ID: AnonymousHasLambdaAlternative"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AnonymousHasLambdaAlternative",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsThread",
+ "shortDescription": {
+ "text": "Class directly extends 'Thread'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that directly extend 'java.lang.Thread'. It is usually recommended to prefer composition over inheritance to create more reusable code that is easier to modify later. Example: 'class MainThread extends Thread {\n }' Inspection ID: ExtendsThread",
+ "markdown": "Reports classes that directly extend `java.lang.Thread`. It is usually recommended to prefer composition over inheritance to create more reusable code that is easier to modify later.\n\n**Example:**\n\n\n class MainThread extends Thread {\n }\n\nInspection ID: ExtendsThread"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassExplicitlyExtendsThread",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifyOptionalCallChains",
+ "shortDescription": {
+ "text": "Optional call chain can be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports Optional call chains that can be simplified. Here are several examples of possible simplifications: 'optional.map(x -> true).orElse(false)' → 'optional.isPresent()' 'optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)' → 'optional.map(String::trim)' 'optional.map(x -> (String)x).orElse(null)' → '(String) optional.orElse(null)' 'Optional.ofNullable(optional.orElse(null))' → 'optional' 'val = optional.orElse(null); val != null ? val : defaultExpr' → 'optional.orElse(defaultExpr)' 'val = optional.orElse(null); if(val != null) expr(val)' → 'optional.ifPresent(val -> expr(val))' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: SimplifyOptionalCallChains New in 2017.2",
+ "markdown": "Reports **Optional** call chains that can be simplified. Here are several examples of possible simplifications:\n\n* `optional.map(x -> true).orElse(false)` → `optional.isPresent()`\n* `optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)` → `optional.map(String::trim)`\n* `optional.map(x -> (String)x).orElse(null)` → `(String) optional.orElse(null)`\n* `Optional.ofNullable(optional.orElse(null))` → `optional`\n* `val = optional.orElse(null); val != null ? val : defaultExpr ` → `optional.orElse(defaultExpr)`\n* `val = optional.orElse(null); if(val != null) expr(val) ` → `optional.ifPresent(val -> expr(val))`\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: SimplifyOptionalCallChains\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifyOptionalCallChains",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RandomDoubleForRandomInteger",
+ "shortDescription": {
+ "text": "Using 'Random.nextDouble()' to get random integer"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.util.Random.nextDouble()' that are used to create a positive integer number by multiplying the call by a factor and casting to an integer. For generating a random positive integer in a range, 'java.util.Random.nextInt(int)' is simpler and more efficient. Example: 'int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }'\n After the quick-fix is applied: 'int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }' Inspection ID: RandomDoubleForRandomInteger",
+ "markdown": "Reports calls to `java.util.Random.nextDouble()` that are used to create a positive integer number by multiplying the call by a factor and casting to an integer.\n\n\nFor generating a random positive integer in a range,\n`java.util.Random.nextInt(int)` is simpler and more efficient.\n\n**Example:**\n\n\n int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }\n \nAfter the quick-fix is applied:\n\n\n int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }\n\nInspection ID: RandomDoubleForRandomInteger"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UsingRandomNextDoubleForRandomInteger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousArrayCast",
+ "shortDescription": {
+ "text": "Suspicious array cast"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a 'ClassCastException' at runtime. Example: 'Number[] numbers = new Number[]{1L, 2L, 4L};\n Long[] longs = (Long[])numbers;' Inspection ID: SuspiciousArrayCast",
+ "markdown": "Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a `ClassCastException` at runtime.\n\n**Example:**\n\n\n Number[] numbers = new Number[]{1L, 2L, 4L};\n Long[] longs = (Long[])numbers;\n\nInspection ID: SuspiciousArrayCast"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousArrayCast",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ZeroLengthArrayInitialization",
+ "shortDescription": {
+ "text": "Zero-length array allocation"
+ },
+ "fullDescription": {
+ "text": "Reports allocations of arrays with known lengths of zero. Since array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly allocate new ones. Such sharing may provide useful optimizations in the program runtime or footprint. Note that the inspection does not report zero-length arrays allocated as static final fields, since those arrays are assumed to be used for implementing array sharing. Inspection ID: ZeroLengthArrayInitialization",
+ "markdown": "Reports allocations of arrays with known lengths of zero.\n\n\nSince array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly\nallocate new ones. Such sharing may provide useful optimizations in the program runtime or footprint.\n\n\nNote that the inspection does not report zero-length arrays allocated as static final fields,\nsince those arrays are assumed to be used for implementing array sharing.\n\nInspection ID: ZeroLengthArrayInitialization"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ZeroLengthArrayAllocation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 175,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DivideByZero",
+ "shortDescription": {
+ "text": "Division by zero"
+ },
+ "fullDescription": {
+ "text": "Reports division by zero or remainder by zero. Such expressions will produce an 'Infinity', '-Infinity' or 'NaN' result for doubles or floats, and will throw an 'ArithmeticException' for integers. When the expression has a 'NaN' result, the fix suggests replacing the division expression with the 'NaN' constant. Inspection ID: DivideByZero",
+ "markdown": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant.\n\n\nInspection ID: DivideByZero"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "divzero",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingSerialAnnotation",
+ "shortDescription": {
+ "text": "'@Serial' annotation can be used"
+ },
+ "fullDescription": {
+ "text": "Reports methods and fields in the 'Serializable' and 'Externalizable' classes that are suitable to be annotated with the 'java.io.Serial' annotation. The quick-fix adds the annotation. Example: 'class Main implements Serializable {\n private static final long serialVersionUID = 7874493593505141603L;\n\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' After the quick-fix is applied: 'class Main implements Serializable {\n @Serial\n private static final long serialVersionUID = 7874493593505141603L;\n\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' Example: 'class Main implements Externalizable {\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }' After the quick-fix is applied: 'class Main implements Externalizable {\n @Serial\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }' For more information about all possible cases, refer to the Javadoc of the 'java.io.Serial' class. This inspection depends on the Java feature '@Serial annotation', which is available since Java 14. Inspection ID: MissingSerialAnnotation New in 2020.3",
+ "markdown": "Reports methods and fields in the `Serializable` and `Externalizable` classes that are suitable to be annotated with the `java.io.Serial` annotation. The quick-fix adds the annotation.\n\n**Example:**\n\n\n class Main implements Serializable {\n private static final long serialVersionUID = 7874493593505141603L;\n\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Serializable {\n @Serial\n private static final long serialVersionUID = 7874493593505141603L;\n\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n**Example:**\n\n\n class Main implements Externalizable {\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Externalizable {\n @Serial\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }\n\nFor more information about all possible cases, refer to the Javadoc of the `java.io.Serial` class.\n\nThis inspection depends on the Java feature '@Serial annotation', which is available since Java 14.\n\nInspection ID: MissingSerialAnnotation\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MissingSerialAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationMissingWhitespace",
+ "shortDescription": {
+ "text": "Whitespace may be missing in string concatenation"
+ },
+ "fullDescription": {
+ "text": "Reports string concatenations with missing whitespaces, that is where the left-hand side ends with a Unicode letter or digit and the right-hand side starts with a Unicode letter or digit. Example: 'String sql = \"SELECT column\" +\n \"FROM table\";' Use the Ignore concatenations with variable strings option to only report when both the left and right side of the concatenation are literals. Inspection ID: StringConcatenationMissingWhitespace",
+ "markdown": "Reports string concatenations with missing whitespaces, that is where the left-hand side ends with a Unicode letter or digit and the right-hand side starts with a Unicode letter or digit.\n\n**Example:**\n\n\n String sql = \"SELECT column\" +\n \"FROM table\";\n\n\nUse the **Ignore concatenations with variable strings** option to only report\nwhen both the left and right side of the concatenation are literals.\n\nInspection ID: StringConcatenationMissingWhitespace"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenationMissingWhitespace",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StandardVariableNames",
+ "shortDescription": {
+ "text": "Standard variable names"
+ },
+ "fullDescription": {
+ "text": "Reports variables with 'standard' names that do not correspond to their types. Such names may be confusing. There are the following standard names for specific types: i, j, k, m, n - 'int' f - 'float' d - 'double' b - 'byte' c, ch - 'char' l - 'long' s, str - 'String' Rename quick-fix is suggested only in the editor. Use the option to ignore parameter names which are identical to the parameter name from a direct super method. Inspection ID: StandardVariableNames",
+ "markdown": "Reports variables with 'standard' names that do not correspond to their types. Such names may be confusing. There are the following standard names for specific types:\n\n* i, j, k, m, n - `int`\n* f - `float`\n* d - `double`\n* b - `byte`\n* c, ch - `char`\n* l - `long`\n* s, str - `String`\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to ignore parameter names which are identical to the parameter name from a direct super method.\n\nInspection ID: StandardVariableNames"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StandardVariableNames",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DeconstructionCanBeUsed",
+ "shortDescription": {
+ "text": "Record pattern can be used"
+ },
+ "fullDescription": {
+ "text": "Reports patterns that can be replaced with record patterns. Example: 'record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point p) {\n int x = p.x();\n int y = p.y();\n System.out.println(x + y);\n }\n }\n }' After the quick-fix is applied: 'record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point(int x, int y)) {\n System.out.println(x + y);\n }\n }\n }' This inspection depends on the Java feature 'Pattern guards and record patterns', which is available since Java 21. Inspection ID: DeconstructionCanBeUsed New in 2023.1",
+ "markdown": "Reports patterns that can be replaced with record patterns.\n\nExample:\n\n\n record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point p) {\n int x = p.x();\n int y = p.y();\n System.out.println(x + y);\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point(int x, int y)) {\n System.out.println(x + y);\n }\n }\n }\n\nThis inspection depends on the Java feature 'Pattern guards and record patterns', which is available since Java 21.\n\nInspection ID: DeconstructionCanBeUsed\n\nNew in 2023.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DeconstructionCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 21",
+ "index": 211,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExceptionFromCatchWhichDoesntWrap",
+ "shortDescription": {
+ "text": "'throw' inside 'catch' block which ignores the caught exception"
+ },
+ "fullDescription": {
+ "text": "Reports exceptions that are thrown from inside 'catch' blocks but do not \"wrap\" the caught exception. When an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information, such as stack frames and line numbers. Example: '...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }' Configure the inspection: Use the Ignore if result of exception method call is used option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as 'getMessage()'. Use the Ignore if thrown exception cannot wrap an exception option to ignore 'throw' statements that throw exceptions without a constructor that accepts a 'Throwable' cause. Inspection ID: ExceptionFromCatchWhichDoesntWrap",
+ "markdown": "Reports exceptions that are thrown from inside `catch` blocks but do not \"wrap\" the caught exception.\n\nWhen an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,\nsuch as stack frames and line numbers.\n\n**Example:**\n\n\n ...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if result of exception method call is used** option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as `getMessage()`.\n* Use the **Ignore if thrown exception cannot wrap an exception** option to ignore `throw` statements that throw exceptions without a constructor that accepts a `Throwable` cause.\n\nInspection ID: ExceptionFromCatchWhichDoesntWrap"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThrowInsideCatchBlockWhichIgnoresCaughtException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodOnlyUsedFromInnerClass",
+ "shortDescription": {
+ "text": "Private method only used from inner class"
+ },
+ "fullDescription": {
+ "text": "Reports 'private' methods which are only called from an inner class of the class containing the method. Such methods can be safely moved into that inner class. Example: 'public class Outer {\n public static void main(String[] args) {\n new Inner().run(args[0]);\n }\n\n static class Inner {\n void run(String arg) {\n // Method isEmpty() is used from Inner class only\n // consider moving it to the Inner class\n if (!isEmpty(arg)) {\n System.out.println(\"Argument is supplied\");\n }\n }\n }\n\n private static boolean isEmpty(String s) {\n return s != null && s.trim().isEmpty();\n }\n}' Use the first checkbox below to ignore 'private' methods which are called from an anonymous or local class. Use the third checkbox to only report 'static' methods. Inspection ID: MethodOnlyUsedFromInnerClass",
+ "markdown": "Reports `private` methods which are only called from an inner class of the class containing the method. Such methods can be safely moved into that inner class.\n\nExample:\n\n\n public class Outer {\n public static void main(String[] args) {\n new Inner().run(args[0]);\n }\n\n static class Inner {\n void run(String arg) {\n // Method isEmpty() is used from Inner class only\n // consider moving it to the Inner class\n if (!isEmpty(arg)) {\n System.out.println(\"Argument is supplied\");\n }\n }\n }\n\n private static boolean isEmpty(String s) {\n return s != null && s.trim().isEmpty();\n }\n }\n\n\nUse the first checkbox below to ignore `private`\nmethods which are called from an anonymous or local class.\n\n\nUse the third checkbox to only report `static` methods.\n\n\nInspection ID: MethodOnlyUsedFromInnerClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodOnlyUsedFromInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 82,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparisonToNaN",
+ "shortDescription": {
+ "text": "Comparison to 'Double.NaN' or 'Float.NaN'"
+ },
+ "fullDescription": {
+ "text": "Reports any comparisons to 'Double.NaN' or 'Float.NaN'. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the 'Double.isNaN()' or 'Float.isNaN()' methods instead. Example: 'if (x == Double.NaN) {...}' After the quick-fix is applied: 'if (Double.isNaN(x)) {...}' Inspection ID: ComparisonToNaN",
+ "markdown": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n\nInspection ID: ComparisonToNaN"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparisonToNaN",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultiCatchCanBeSplit",
+ "shortDescription": {
+ "text": "Multi-catch can be split into separate catch blocks"
+ },
+ "fullDescription": {
+ "text": "Reports multi-'catch' sections and suggests splitting them into separate 'catch' blocks. Example: 'try {\n int i = getIndex();\n } catch (NullPointerException|IndexOutOfBoundsException e) {\n e.printStackTrace();\n }' After the quick-fix is applied: 'try {\n int i = getIndex();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (IndexOutOfBoundsException e) {\n e.printStackTrace();\n }' This inspection depends on the Java feature 'Multi-catches', which is available since Java 7. Inspection ID: MultiCatchCanBeSplit",
+ "markdown": "Reports multi-`catch` sections and suggests splitting them into separate `catch` blocks.\n\nExample:\n\n\n try {\n int i = getIndex();\n } catch (NullPointerException|IndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n int i = getIndex();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (IndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n\nThis inspection depends on the Java feature 'Multi-catches', which is available since Java 7.\n\nInspection ID: MultiCatchCanBeSplit"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MultiCatchCanBeSplit",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ResultSetIndexZero",
+ "shortDescription": {
+ "text": "Use of index 0 in JDBC ResultSet"
+ },
+ "fullDescription": {
+ "text": "Reports attempts to access column 0 of 'java.sql.ResultSet' or 'java.sql.PreparedStatement'. For historical reasons, columns of 'java.sql.ResultSet' and 'java.sql.PreparedStatement' are numbered starting with 1, rather than with 0, and accessing column 0 is a common error in JDBC programming. Example: 'String getName(ResultSet rs) {\n return rs.getString(0);\n }' Inspection ID: ResultSetIndexZero",
+ "markdown": "Reports attempts to access column 0 of `java.sql.ResultSet` or `java.sql.PreparedStatement`. For historical reasons, columns of `java.sql.ResultSet` and `java.sql.PreparedStatement` are numbered starting with **1** , rather than with **0** , and accessing column 0 is a common error in JDBC programming.\n\n**Example:**\n\n\n String getName(ResultSet rs) {\n return rs.getString(0);\n }\n\nInspection ID: ResultSetIndexZero"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfIndexZeroInJDBCResultSet",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionCoveredByFurtherCondition",
+ "shortDescription": {
+ "text": "Condition is covered by further condition"
+ },
+ "fullDescription": {
+ "text": "Reports conditions that become redundant as they are completely covered by a subsequent condition. For example, in the 'value != -1 && value > 0' condition, the first part is redundant: if it's false, then the second part is also false. Or in a condition like 'obj != null && obj instanceof String', the null-check is redundant as 'instanceof' operator implies non-nullity. Inspection ID: ConditionCoveredByFurtherCondition New in 2018.3",
+ "markdown": "Reports conditions that become redundant as they are completely covered by a subsequent condition.\n\nFor example, in the `value != -1 && value > 0` condition, the first part is redundant:\nif it's false, then the second part is also false.\nOr in a condition like `obj != null && obj instanceof String`,\nthe null-check is redundant as `instanceof` operator implies non-nullity.\n\nInspection ID: ConditionCoveredByFurtherCondition\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConditionCoveredByFurtherCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PatternVariableHidesField",
+ "shortDescription": {
+ "text": "Pattern variable hides field"
+ },
+ "fullDescription": {
+ "text": "Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'class Pointless {\n Point p = new Point();\n\n public void test(Object a) {\n if (a instanceof Point p) {\n System.out.print(\"a is a point (\" + p.x + \", \" + p.y + ')');\n } else {\n System.out.print(\"p is a point (\" + p.x + \", \" + p.y + ')');\n }\n }\n }' Inspection ID: PatternVariableHidesField New in 2022.2",
+ "markdown": "Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended.\n\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n class Pointless {\n Point p = new Point();\n\n public void test(Object a) {\n if (a instanceof Point p) {\n System.out.print(\"a is a point (\" + p.x + \", \" + p.y + ')');\n } else {\n System.out.print(\"p is a point (\" + p.x + \", \" + p.y + ')');\n }\n }\n }\n\nInspection ID: PatternVariableHidesField\n\nNew in 2022.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PatternVariableHidesField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JoinDeclarationAndAssignmentJava",
+ "shortDescription": {
+ "text": "Assignment can be joined with declaration"
+ },
+ "fullDescription": {
+ "text": "Reports variable assignments that can be joined with a variable declaration. Example: 'int x;\n x = 1;' The quick-fix converts the assignment into an initializer: 'int x = 1;' Inspection ID: JoinDeclarationAndAssignmentJava New in 2018.3",
+ "markdown": "Reports variable assignments that can be joined with a variable declaration.\n\nExample:\n\n\n int x;\n x = 1;\n\nThe quick-fix converts the assignment into an initializer:\n\n\n int x = 1;\n\nInspection ID: JoinDeclarationAndAssignmentJava\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "JoinDeclarationAndAssignmentJava",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassVariableHidesOuterClassVariable",
+ "shortDescription": {
+ "text": "Inner class field hides outer class field"
+ },
+ "fullDescription": {
+ "text": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended. A quick-fix is suggested to rename the inner class field. Example: 'class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }' Use the option to choose whether this inspection should report all name clashes, or only clashes with fields that are visible from the inner class. Inspection ID: InnerClassVariableHidesOuterClassVariable",
+ "markdown": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended.\n\nA quick-fix is suggested to rename the inner class field.\n\n**Example:**\n\n\n class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }\n\n\nUse the option to choose whether this inspection should report all name clashes,\nor only clashes with fields that are visible from the inner class.\n\nInspection ID: InnerClassVariableHidesOuterClassVariable"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassFieldHidesOuterClassField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MISSORTED_IMPORTS",
+ "shortDescription": {
+ "text": "Missorted imports"
+ },
+ "fullDescription": {
+ "text": "Reports 'import' statements which are not arranged according to the current code style (see Settings|Editor|Code Style). Example: 'import java.util.List;\n import java.util.ArrayList;\n\n public class Example {\n List list = new ArrayList();\n }' After the \"Optimize Imports\" quick fix is applied: 'import java.util.ArrayList;\n import java.util.List;\n\n public class Example {\n List list = new ArrayList();\n }' Inspection ID: MISSORTED_IMPORTS",
+ "markdown": "Reports `import` statements which are not arranged according to the current code style (see Settings\\|Editor\\|Code Style).\n\n**Example:**\n\n\n import java.util.List;\n import java.util.ArrayList;\n\n public class Example {\n List list = new ArrayList();\n }\n\nAfter the \"Optimize Imports\" quick fix is applied:\n\n\n import java.util.ArrayList;\n import java.util.List;\n\n public class Example {\n List list = new ArrayList();\n }\n\nInspection ID: MISSORTED_IMPORTS"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MISSORTED_IMPORTS",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonThreadSafeLazyInitialization",
+ "shortDescription": {
+ "text": "Unsafe lazy initialization of 'static' field"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' variables that are lazily initialized in a non-thread-safe manner. Lazy initialization of 'static' variables should be done with an appropriate synchronization construct to prevent different threads from performing conflicting initialization. When applicable, a quick-fix, which introduces the lazy initialization holder class idiom, is suggested. This idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used. Example: 'class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }' After the quick-fix is applied: 'class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }' Inspection ID: NonThreadSafeLazyInitialization",
+ "markdown": "Reports `static` variables that are lazily initialized in a non-thread-safe manner.\n\nLazy initialization of `static` variables should be done with an appropriate synchronization construct\nto prevent different threads from performing conflicting initialization.\n\nWhen applicable, a quick-fix, which introduces the\n[lazy initialization holder class idiom](https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom), is suggested.\nThis idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used.\n\n**Example:**\n\n\n class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }\n\nInspection ID: NonThreadSafeLazyInitialization"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonThreadSafeLazyInitialization",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryModifier",
+ "shortDescription": {
+ "text": "Unnecessary modifier"
+ },
+ "fullDescription": {
+ "text": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same. Example 1: '// all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }' Example 2: 'final record R() {\n // all records are implicitly final\n }' Example 3: '// all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }' Inspection ID: UnnecessaryModifier",
+ "markdown": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same.\n\n**Example 1:**\n\n\n // all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }\n\n**Example 2:**\n\n\n final record R() {\n // all records are implicitly final\n }\n\n**Example 3:**\n\n\n // all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }\n\n\nInspection ID: UnnecessaryModifier"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryModifier",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionalCanBePushedInsideExpression",
+ "shortDescription": {
+ "text": "Conditional can be pushed inside branch expression"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions with 'then' and else branches that are similar enough so that the expression can be moved inside. This action shortens the code. Example: 'double g(int a, int b) {\n return a == b ? Math.cos(0) : Math.cos(1);\n }' After the quick-fix is applied: 'double g(int a, int b) {\n return Math.cos(a == b ? 0 : 1);\n }' Inspection ID: ConditionalCanBePushedInsideExpression New in 2017.2",
+ "markdown": "Reports conditional expressions with `then` and else branches that are similar enough so that the expression can be moved inside. This action shortens the code.\n\nExample:\n\n\n double g(int a, int b) {\n return a == b ? Math.cos(0) : Math.cos(1);\n }\n\nAfter the quick-fix is applied:\n\n\n double g(int a, int b) {\n return Math.cos(a == b ? 0 : 1);\n }\n\nInspection ID: ConditionalCanBePushedInsideExpression\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ConditionalCanBePushedInsideExpression",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CloneInNonCloneableClass",
+ "shortDescription": {
+ "text": "'clone()' method in non-Cloneable class"
+ },
+ "fullDescription": {
+ "text": "Reports classes that override the 'clone()' method but don't implement the 'Cloneable' interface. This usually represents a programming error. Use the Only warn on 'public' clone methods option to ignore methods that aren't 'public'. For classes designed to be inherited, you may choose to override 'clone()' and declare it as 'protected' without implementing the 'Cloneable' interface and decide whether to implement the 'Cloneable' interface in subclasses. Inspection ID: CloneInNonCloneableClass",
+ "markdown": "Reports classes that override the `clone()` method but don't implement the `Cloneable` interface. This usually represents a programming error.\n\n\nUse the **Only warn on 'public' clone methods** option to ignore methods that aren't `public`.\n\nFor classes designed to be inherited, you may choose to override `clone()` and declare it as `protected`\nwithout implementing the `Cloneable` interface and decide whether to implement the `Cloneable` interface in subclasses.\n\nInspection ID: CloneInNonCloneableClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CloneInNonCloneableClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 117,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java8ListReplaceAll",
+ "shortDescription": {
+ "text": "Loop can be replaced with 'List.replaceAll()'"
+ },
+ "fullDescription": {
+ "text": "Reports loops which can be collapsed into a single 'List.replaceAll()' call. Example: 'for (int i = 0; i < strings.size(); i++) {\n String str = strings.get(i).toLowerCase();\n strings.set(i, str);\n }' After the quick-fix is applied: 'strings.replaceAll(String::toLowerCase);' This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8ListReplaceAll New in 2022.1",
+ "markdown": "Reports loops which can be collapsed into a single `List.replaceAll()` call.\n\n**Example:**\n\n\n for (int i = 0; i < strings.size(); i++) {\n String str = strings.get(i).toLowerCase();\n strings.set(i, str);\n }\n\nAfter the quick-fix is applied:\n\n\n strings.replaceAll(String::toLowerCase);\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8ListReplaceAll\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java8ListReplaceAll",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BigDecimalLegacyMethod",
+ "shortDescription": {
+ "text": "'BigDecimal' legacy method called"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'BigDecimal.divide()' or 'BigDecimal.setScale()' that use integer constants to specify the rounding mode. Since JDK 1.5, consider using methods that take the 'RoundingMode' 'enum' parameter instead. Example: 'new BigDecimal(\"42\").setScale(2, BigDecimal.ROUND_FLOOR);' After the quick-fix is applied: 'new BigDecimal(\"42\").setScale(2, RoundingMode.FLOOR);' Inspection ID: BigDecimalLegacyMethod",
+ "markdown": "Reports calls to `BigDecimal.divide()` or `BigDecimal.setScale()` that use integer constants to specify the rounding mode. Since JDK 1.5, consider using methods that take the `RoundingMode` `enum` parameter instead.\n\n**Example:**\n\n new BigDecimal(\"42\").setScale(2, BigDecimal.ROUND_FLOOR);\n\nAfter the quick-fix is applied:\n\n new BigDecimal(\"42\").setScale(2, RoundingMode.FLOOR);\n\n\nInspection ID: BigDecimalLegacyMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BigDecimalLegacyMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 123,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingPackageInfo",
+ "shortDescription": {
+ "text": "Missing 'package-info.java'"
+ },
+ "fullDescription": {
+ "text": "Reports packages that contain classes but do not contain the 'package-info.java' or 'package.html' files and are, thus, missing the package documentation. The quick-fix creates an initial 'package-info.java' file. Inspection ID: MissingPackageInfo",
+ "markdown": "Reports packages that contain classes but do not contain the `package-info.java` or `package.html` files and are, thus, missing the package documentation.\n\nThe quick-fix creates an initial `package-info.java` file.\n\n\nInspection ID: MissingPackageInfo"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MissingPackageInfo",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryConstructor",
+ "shortDescription": {
+ "text": "Redundant no-arg constructor"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary constructors. A constructor is unnecessary if it is the only constructor of a class, has no parameters, has the same access modifier as its containing class, and does not perform any initialization except explicitly or implicitly calling the superclass constructor without arguments. Such a constructor can be safely removed as it will be generated by the compiler even if not specified. Example: 'public class Foo {\n public Foo() {}\n }' After the quick-fix is applied: 'public class Foo {}' Use the inspection settings to ignore unnecessary constructors that have an annotation. Inspection ID: UnnecessaryConstructor",
+ "markdown": "Reports unnecessary constructors.\n\n\nA constructor is unnecessary if it is the only constructor of a class, has no parameters,\nhas the same access modifier as its containing class,\nand does not perform any initialization except explicitly or implicitly calling the superclass constructor without arguments.\nSuch a constructor can be safely removed as it will be generated by the compiler even if not specified.\n\n**Example:**\n\n\n public class Foo {\n public Foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class Foo {}\n\n\nUse the inspection settings to ignore unnecessary constructors that have an annotation.\n\n\nInspection ID: UnnecessaryConstructor"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantNoArgConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringBufferField",
+ "shortDescription": {
+ "text": "'StringBuilder' field"
+ },
+ "fullDescription": {
+ "text": "Reports fields of type 'java.lang.StringBuffer' or 'java.lang.StringBuilder'. Such fields can grow without limit and are often the cause of memory leaks. Example: 'public class Example {\n private StringBuilder builder = new StringBuilder();\n\n }' Inspection ID: StringBufferField",
+ "markdown": "Reports fields of type `java.lang.StringBuffer` or `java.lang.StringBuilder`. Such fields can grow without limit and are often the cause of memory leaks.\n\n**Example:**\n\n\n public class Example {\n private StringBuilder builder = new StringBuilder();\n\n }\n\nInspection ID: StringBufferField"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringBufferField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 175,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNameSameAsAncestorName",
+ "shortDescription": {
+ "text": "Class name same as ancestor name"
+ },
+ "fullDescription": {
+ "text": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor. Inspection ID: ClassNameSameAsAncestorName",
+ "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor.\n\nInspection ID: ClassNameSameAsAncestorName"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNameSameAsAncestorName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 77,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantMethodOverride",
+ "shortDescription": {
+ "text": "Method is identical to its super method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed. Use the first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods. Inspection ID: RedundantMethodOverride",
+ "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods.\n\nInspection ID: RedundantMethodOverride"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantMethodOverride",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ContinueStatementWithLabel",
+ "shortDescription": {
+ "text": "'continue' statement with label"
+ },
+ "fullDescription": {
+ "text": "Reports 'continue' statements with labels. Labeled 'continue' statements complicate refactoring and can be confusing. Example: 'void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) continue outer;\n handleChar(ch);\n }\n }\n }' Inspection ID: ContinueStatementWithLabel",
+ "markdown": "Reports `continue` statements with labels.\n\nLabeled `continue` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) continue outer;\n handleChar(ch);\n }\n }\n }\n\nInspection ID: ContinueStatementWithLabel"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ContinueStatementWithLabel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableBooleanExpression",
+ "shortDescription": {
+ "text": "Simplifiable boolean expression"
+ },
+ "fullDescription": {
+ "text": "Reports boolean expressions that can be simplified. Example: 'void f(boolean foo, boolean bar) {\n boolean b = !(foo ^ bar);\n }' After the quick-fix is applied: 'void f(boolean foo, boolean bar) {\n boolean b = foo == bar;\n }' Example: 'void f(boolean foo, boolean bar) {\n boolean b = (foo && bar) || !foo;\n }' After the quick-fix is applied: 'void f(boolean foo, boolean bar) {\n boolean b = !foo || bar;\n }' Inspection ID: SimplifiableBooleanExpression",
+ "markdown": "Reports boolean expressions that can be simplified.\n\nExample:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = !(foo ^ bar);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = foo == bar;\n }\n\nExample:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = (foo && bar) || !foo;\n }\n \nAfter the quick-fix is applied:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = !foo || bar;\n }\n \nInspection ID: SimplifiableBooleanExpression"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableBooleanExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaExistingMethodCanBeUsed",
+ "shortDescription": {
+ "text": "Copy of existing static method body"
+ },
+ "fullDescription": {
+ "text": "Reports fragments of Java code which are identical to the existing static methods suggesting to reuse these static methods. Reusing existing methods makes code shorter and more readable. Example: 'static List readFileAndTrim(Path path) throws IOException {\n List lines = Files.readAllLines(path);\n return lines.stream().map(String::trim).toList();\n }\n \n static List readFileAndTrim(String path) throws IOException {\n Path p = Path.of(path);\n List lines = Files.readAllLines(p);\n return lines.stream().map(String::trim).toList();\n }' Here, the second method is quite similar to the first one, and the first one can be reused in its implementation. After the quick-fix is applied, the result will look like this: 'static List readFileAndTrim(Path path) throws IOException {\n List lines = Files.readAllLines(path);\n return lines.stream().map(String::trim).toList();\n }\n\n static List readFileAndTrim(String path) throws IOException {\n Path p = Path.of(path);\n return readFileAndTrim(p);\n }' Inspection ID: JavaExistingMethodCanBeUsed New in 2024.1",
+ "markdown": "Reports fragments of Java code which are identical to the existing static methods suggesting to reuse these static methods. Reusing existing methods makes code shorter and more readable.\n\nExample:\n\n\n static List readFileAndTrim(Path path) throws IOException {\n List lines = Files.readAllLines(path);\n return lines.stream().map(String::trim).toList();\n }\n \n static List readFileAndTrim(String path) throws IOException {\n Path p = Path.of(path);\n List lines = Files.readAllLines(p);\n return lines.stream().map(String::trim).toList();\n }\n\nHere, the second method is quite similar to the first one, and the first one can be reused in its implementation. After the quick-fix is applied, the result will look like this:\n\n\n static List readFileAndTrim(Path path) throws IOException {\n List lines = Files.readAllLines(path);\n return lines.stream().map(String::trim).toList();\n }\n\n static List readFileAndTrim(String path) throws IOException {\n Path p = Path.of(path);\n return readFileAndTrim(p);\n }\n\nInspection ID: JavaExistingMethodCanBeUsed\n\nNew in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "JavaExistingMethodCanBeUsed",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SignalWithoutCorrespondingAwait",
+ "shortDescription": {
+ "text": "'signal()' without corresponding 'await()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Condition.signal()' or 'Condition.signalAll()' for which no call to a corresponding 'Condition.await()' can be found. Only calls that target fields of the current class are reported by this inspection. Example: 'class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n isEmpty.signal(); // warning: Call to 'signal()' without corresponding 'await()'\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n // isEmpty.await();\n // ...\n }\n }' Inspection ID: SignalWithoutCorrespondingAwait",
+ "markdown": "Reports calls to `Condition.signal()` or `Condition.signalAll()` for which no call to a corresponding `Condition.await()` can be found.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n isEmpty.signal(); // warning: Call to 'signal()' without corresponding 'await()'\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n // isEmpty.await();\n // ...\n }\n }\n\nInspection ID: SignalWithoutCorrespondingAwait"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SignalWithoutCorrespondingAwait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FoldExpressionIntoStream",
+ "shortDescription": {
+ "text": "Expression can be folded into Stream chain"
+ },
+ "fullDescription": {
+ "text": "Reports expressions with a repeating pattern that could be replaced with Stream API or a 'String.join()' call. Example: 'boolean allStartWith(String a, String b, String c, String d, String prefix) {\n return a.startsWith(prefix) && b.startsWith(prefix) && c.startsWith(prefix) && d.startsWith(prefix);\n }' After the quick-fix is applied: 'boolean foo(String a, String b, String c, String d, String prefix) {\n return Stream.of(a, b, c, d).allMatch(s -> s.startsWith(prefix));\n }' Example: 'String joinAll(String a, String b, String c, String d) {\n return a + \",\" + b + \",\" + c + \",\" + d;\n }' After the quick-fix is applied: 'String joinAll(String a, String b, String c, String d) {\n return String.join(\",\", a, b, c, d);\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: FoldExpressionIntoStream New in 2018.2",
+ "markdown": "Reports expressions with a repeating pattern that could be replaced with *Stream API* or a `String.join()` call.\n\nExample:\n\n\n boolean allStartWith(String a, String b, String c, String d, String prefix) {\n return a.startsWith(prefix) && b.startsWith(prefix) && c.startsWith(prefix) && d.startsWith(prefix);\n }\n\nAfter the quick-fix is applied:\n\n\n boolean foo(String a, String b, String c, String d, String prefix) {\n return Stream.of(a, b, c, d).allMatch(s -> s.startsWith(prefix));\n }\n\nExample:\n\n\n String joinAll(String a, String b, String c, String d) {\n return a + \",\" + b + \",\" + c + \",\" + d;\n }\n\nAfter the quick-fix is applied:\n\n\n String joinAll(String a, String b, String c, String d) {\n return String.join(\",\", a, b, c, d);\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: FoldExpressionIntoStream\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "FoldExpressionIntoStream",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableDeserializableClassInSecureContext",
+ "shortDescription": {
+ "text": "Serializable class in secure context"
+ },
+ "fullDescription": {
+ "text": "Reports classes that may be serialized or deserialized. A class may be serialized if it supports the 'Serializable' interface, and its 'readObject()' and 'writeObject()' methods are not defined to always throw an exception. Serializable classes may be dangerous in code intended for secure use. Example: 'class DeserializableClass implements Serializable { // the class doesn't contain 'writeObject()' method throwing an exception\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n}' After the quick-fix is applied: 'class DeserializableClass implements Serializable {\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n\n private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {\n throw new java.io.NotSerializableException(\"DeserializableClass\");\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Note that it still may be more secure to add 'readObject()' and 'writeObject()' methods which always throw an exception, instead of ignoring those classes. Whether to ignore serializable anonymous classes. Inspection ID: SerializableDeserializableClassInSecureContext",
+ "markdown": "Reports classes that may be serialized or deserialized.\n\n\nA class may be serialized if it supports the `Serializable` interface,\nand its `readObject()` and `writeObject()` methods are not defined to always\nthrow an exception. Serializable classes may be dangerous in code intended for secure use.\n\n**Example:**\n\n\n class DeserializableClass implements Serializable { // the class doesn't contain 'writeObject()' method throwing an exception\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class DeserializableClass implements Serializable {\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n\n private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {\n throw new java.io.NotSerializableException(\"DeserializableClass\");\n }\n }\n\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization. Note that it still may be more secure to add `readObject()` and `writeObject()` methods which always throw an exception, instead of ignoring those classes.\n* Whether to ignore serializable anonymous classes.\n\nInspection ID: SerializableDeserializableClassInSecureContext"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableDeserializableClassInSecureContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 37,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaModuleNaming",
+ "shortDescription": {
+ "text": "Java module name violates convention"
+ },
+ "fullDescription": {
+ "text": "Reports module names in 'module-info.java' that violate the Java Platform Module System recommendation to avoid encoding version information in module names by ending the name with one or more digits. Example: 'module foo.bar2 {}' After the quick-fix is applied: 'module foo.bar {}' Inspection ID: JavaModuleNaming",
+ "markdown": "Reports module names in `module-info.java` that violate the Java Platform Module System [recommendation](http://mail.openjdk.org/pipermail/jpms-spec-experts/2017-March/000659.html) to avoid encoding version information in module names by ending the name with one or more digits.\n\n**Example:**\n\n\n module foo.bar2 {}\n\nAfter the quick-fix is applied:\n\n\n module foo.bar {}\n\nInspection ID: JavaModuleNaming"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "module",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnaryPlus",
+ "shortDescription": {
+ "text": "Unary plus"
+ },
+ "fullDescription": {
+ "text": "Reports usages of the '+' unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in '+++') or with the equal operator (like in '=+'). Example: 'void unaryPlus(int i) {\n int x = + +i;\n }' The following quick fixes are suggested: Remove '+' operators before the 'i' variable: 'void unaryPlus(int i) {\n int x = i;\n }' Replace '+' operators with the prefix increment operator: 'void unaryPlus(int i) {\n int x = ++i;\n }' Use the checkbox below to report unary pluses that are used together with a binary or another unary expression. It means the inspection will not report situations when a unary plus expression is used in array initializer expressions or as a method argument. Inspection ID: UnaryPlus",
+ "markdown": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument.\n\nInspection ID: UnaryPlus"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnaryPlus",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstructorCount",
+ "shortDescription": {
+ "text": "Class with too many constructors"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose number of constructors exceeds the specified maximum. Classes with too many constructors are prone to initialization errors, and often modeling such a class as multiple subclasses is preferable. Configure the inspection: Use the Constructor count limit field to specify the maximum allowed number of constructors in a class. Use the Ignore deprecated constructors option to avoid adding deprecated constructors to the total count. Inspection ID: ConstructorCount",
+ "markdown": "Reports classes whose number of constructors exceeds the specified maximum.\n\nClasses with too many constructors are prone to initialization errors, and often modeling such a class as multiple subclasses is preferable.\n\nConfigure the inspection:\n\n* Use the **Constructor count limit** field to specify the maximum allowed number of constructors in a class.\n* Use the **Ignore deprecated constructors** option to avoid adding deprecated constructors to the total count.\n\nInspection ID: ConstructorCount"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyConstructors",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 127,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IncrementDecrementUsedAsExpression",
+ "shortDescription": {
+ "text": "Result of '++' or '--' used"
+ },
+ "fullDescription": {
+ "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;' Inspection ID: IncrementDecrementUsedAsExpression",
+ "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n\nInspection ID: IncrementDecrementUsedAsExpression"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ValueOfIncrementOrDecrementUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 83,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DisjointPackage",
+ "shortDescription": {
+ "text": "Package with disjoint dependency graph"
+ },
+ "fullDescription": {
+ "text": "Reports packages whose classes can be separated into mutually independent subsets. Such disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: DisjointPackage",
+ "markdown": "Reports packages whose classes can be separated into mutually independent subsets.\n\nSuch disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: DisjointPackage"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DisjointPackage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Packaging issues",
+ "index": 47,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodOverloadsParentMethod",
+ "shortDescription": {
+ "text": "Possibly unintended overload of method from superclass"
+ },
+ "fullDescription": {
+ "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible. Inspection ID: MethodOverloadsParentMethod",
+ "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible.\n\n\nInspection ID: MethodOverloadsParentMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodOverloadsMethodOfSuperclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UpperCaseFieldNameNotConstant",
+ "shortDescription": {
+ "text": "Non-constant field with upper-case name"
+ },
+ "fullDescription": {
+ "text": "Reports non-'static' non-'final' fields whose names are all in upper case. Such fields may cause confusion by breaking a common naming convention and are often used by mistake. Example: 'public static int THE_ANSWER = 42; //a warning here: final modifier is missing' A quick-fix that renames such fields is available only in the editor. Inspection ID: UpperCaseFieldNameNotConstant",
+ "markdown": "Reports non-`static` non-`final` fields whose names are all in upper case.\n\nSuch fields may cause confusion by breaking a common naming convention and\nare often used by mistake.\n\n**Example:**\n\n\n public static int THE_ANSWER = 42; //a warning here: final modifier is missing\n\nA quick-fix that renames such fields is available only in the editor.\n\nInspection ID: UpperCaseFieldNameNotConstant"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonConstantFieldWithUpperCaseName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodMayBeSynchronized",
+ "shortDescription": {
+ "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }' Inspection ID: MethodMayBeSynchronized",
+ "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n\nInspection ID: MethodMayBeSynchronized"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodMayBeSynchronized",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Convert2streamapi",
+ "shortDescription": {
+ "text": "Loop can be collapsed with Stream API"
+ },
+ "fullDescription": {
+ "text": "Reports loops which can be replaced with stream API calls using lambda expressions. Such a replacement changes the style from imperative to more functional and makes the code more compact. Example: 'boolean check(List data) {\n for (String e : data) {\n String trimmed = e.trim();\n if (!trimmed.startsWith(\"xyz\")) {\n return false;\n }\n }\n return true;\n }' After the quick-fix is applied: 'boolean check(List data) {\n return data.stream().map(String::trim).allMatch(trimmed -> trimmed.startsWith(\"xyz\"));\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: Convert2streamapi",
+ "markdown": "Reports loops which can be replaced with stream API calls using lambda expressions.\n\nSuch a replacement changes the style from imperative to more functional and makes the code more compact.\n\nExample:\n\n\n boolean check(List data) {\n for (String e : data) {\n String trimmed = e.trim();\n if (!trimmed.startsWith(\"xyz\")) {\n return false;\n }\n }\n return true;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean check(List data) {\n return data.stream().map(String::trim).allMatch(trimmed -> trimmed.startsWith(\"xyz\"));\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: Convert2streamapi"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "Convert2streamapi",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerialPersistentFieldsWithWrongSignature",
+ "shortDescription": {
+ "text": "'serialPersistentFields' field not declared 'private static final ObjectStreamField[]'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes whose 'serialPersistentFields' field is not declared as 'private static final ObjectStreamField[]'. If a 'serialPersistentFields' field is not declared with those modifiers, the serialization behavior will be as if the field was not declared at all. Example: 'class List implements Serializable {\n private List next;\n\n ObjectStreamField[] serialPersistentFields = {new ObjectStreamField(\"next\", List.class)};\n\n }' Inspection ID: SerialPersistentFieldsWithWrongSignature",
+ "markdown": "Reports `Serializable` classes whose `serialPersistentFields` field is not declared as `private static final ObjectStreamField[]`.\n\n\nIf a `serialPersistentFields` field is not declared with those modifiers,\nthe serialization behavior will be as if the field was not declared at all.\n\n**Example:**\n\n\n class List implements Serializable {\n private List next;\n\n ObjectStreamField[] serialPersistentFields = {new ObjectStreamField(\"next\", List.class)};\n\n }\n\nInspection ID: SerialPersistentFieldsWithWrongSignature"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerialPersistentFieldsWithWrongSignature",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparatorResultComparison",
+ "shortDescription": {
+ "text": "Suspicious usage of compare method"
+ },
+ "fullDescription": {
+ "text": "Reports comparisons of the result of 'Comparator.compare()' or 'Comparable.compareTo()' calls with non-zero constants. By contract, these methods can return any integer (not just -1, 0 or 1), so comparing against particular numbers is bad practice. Some widely used comparison methods (e.g. 'String.compareTo()') actually return values outside the [-1..1] range, and such a comparison may cause incorrect program behavior. Example: 'void validate(String s1, String s2) {\n // Comparing to 1 is incorrect\n if (s1.compareTo(s2) == 1) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }' After the quick-fix is applied: 'void validate(String s1, String s2) {\n if (s1.compareTo(s2) > 0) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }' Inspection ID: ComparatorResultComparison New in 2017.2",
+ "markdown": "Reports comparisons of the result of `Comparator.compare()` or `Comparable.compareTo()` calls with non-zero constants. By contract, these methods can return any integer (not just -1, 0 or 1), so comparing against particular numbers is bad practice. Some widely used comparison methods (e.g. `String.compareTo()`) actually return values outside the \\[-1..1\\] range, and such a comparison may cause incorrect program behavior.\n\nExample:\n\n\n void validate(String s1, String s2) {\n // Comparing to 1 is incorrect\n if (s1.compareTo(s2) == 1) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void validate(String s1, String s2) {\n if (s1.compareTo(s2) > 0) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }\n\nInspection ID: ComparatorResultComparison\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparatorResultComparison",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ListIndexOfReplaceableByContains",
+ "shortDescription": {
+ "text": "'List.indexOf()' expression can be replaced with 'contains()'"
+ },
+ "fullDescription": {
+ "text": "Reports any 'List.indexOf()' expressions that can be replaced with the 'List.contains()' method. Example: 'boolean hasEmptyString(List list) {\n // Warning: can be simplified\n return list.indexOf(\"\") >= 0;\n }' The provided quick-fix replaces the 'indexOf' call with the 'contains' call: 'boolean hasEmptyString(List list) {\n // Quick-fix is applied\n return list.contains(\"\");\n }' Inspection ID: ListIndexOfReplaceableByContains",
+ "markdown": "Reports any `List.indexOf()` expressions that can be replaced with the `List.contains()` method.\n\nExample:\n\n\n boolean hasEmptyString(List list) {\n // Warning: can be simplified\n return list.indexOf(\"\") >= 0;\n }\n\nThe provided quick-fix replaces the `indexOf` call with the `contains` call:\n\n\n boolean hasEmptyString(List list) {\n // Quick-fix is applied\n return list.contains(\"\");\n }\n\nInspection ID: ListIndexOfReplaceableByContains"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ListIndexOfReplaceableByContains",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonStrictComparisonCanBeEquality",
+ "shortDescription": {
+ "text": "Non-strict inequality '>=' or '<=' can be replaced with '=='"
+ },
+ "fullDescription": {
+ "text": "Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer. Example: 'if (x >= 10) {\n ...\n if (x <= 10) { // can be replaced with 'x == 10'\n }\n }' Inspection ID: NonStrictComparisonCanBeEquality New in 2022.2",
+ "markdown": "Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer.\n\nExample:\n\n\n if (x >= 10) {\n ...\n if (x <= 10) { // can be replaced with 'x == 10'\n }\n }\n\nInspection ID: NonStrictComparisonCanBeEquality\n\nNew in 2022.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "NonStrictComparisonCanBeEquality",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryParentheses",
+ "shortDescription": {
+ "text": "Unnecessary parentheses"
+ },
+ "fullDescription": {
+ "text": "Reports any instance of unnecessary parentheses. Parentheses are considered unnecessary if the evaluation order of an expression remains unchanged after you remove the parentheses. Example: 'int n = 3 + (9 * 8);' After quick-fix is applied: 'int n = 3 + 9 * 8;' Configure the inspection: Use the Ignore clarifying parentheses option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an 'instanceof' expression that is a part of a larger expression or has a different operator than the parent expression. Use the Ignore parentheses around the condition of conditional expressions option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses. Use the Ignore parentheses around single no formal type lambda parameter option to ignore parentheses around a single lambda parameter within a lambda expression. Inspection ID: UnnecessaryParentheses",
+ "markdown": "Reports any instance of unnecessary parentheses.\n\nParentheses are considered unnecessary if the evaluation order of an expression remains\nunchanged after you remove the parentheses.\n\nExample:\n\n\n int n = 3 + (9 * 8);\n\nAfter quick-fix is applied:\n\n\n int n = 3 + 9 * 8;\n\nConfigure the inspection:\n\n* Use the **Ignore clarifying parentheses** option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an `instanceof` expression that is a part of a larger expression or has a different operator than the parent expression.\n* Use the **Ignore parentheses around the condition of conditional expressions** option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses.\n* Use the **Ignore parentheses around single no formal type lambda parameter** option to ignore parentheses around a single lambda parameter within a lambda expression.\n\nInspection ID: UnnecessaryParentheses"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnnecessaryParentheses",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousToArrayCall",
+ "shortDescription": {
+ "text": "Suspicious 'Collection.toArray()' call"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious calls to 'Collection.toArray()'. The following types of calls are considered suspicious: when the type of the array argument is not the same as the array type to which the result is casted. when the type of the array argument does not match the type parameter in the collection declaration. Example: 'void m1(List list) {\n Number[] ns = (Number[]) list.toArray(new String[0]);\n}\n\nvoid m2(List list) {\n Number[] ns = list.toArray(new String[0]);\n}' Inspection ID: SuspiciousToArrayCall",
+ "markdown": "Reports suspicious calls to `Collection.toArray()`.\n\nThe following types of calls are considered suspicious:\n\n* when the type of the array argument is not the same as the array type to which the result is casted.\n* when the type of the array argument does not match the type parameter in the collection declaration.\n\n**Example:**\n\n\n void m1(List list) {\n Number[] ns = (Number[]) list.toArray(new String[0]);\n }\n\n void m2(List list) {\n Number[] ns = list.toArray(new String[0]);\n }\n\nInspection ID: SuspiciousToArrayCall"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousToArrayCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringToUpperWithoutLocale",
+ "shortDescription": {
+ "text": "Call to 'String.toUpperCase()' or 'toLowerCase()' without locale"
+ },
+ "fullDescription": {
+ "text": "Reports 'toUpperCase()' or 'toLowerCase()' calls on 'String' objects that do not specify a 'java.util.Locale'. In these cases the default system locale is used, which can cause problems in an internationalized environment. For example the code '\"i\".toUpperCase().equals(\"I\")' returns 'false' in the Turkish and Azerbaijani locales, where the dotted and dotless 'i' are separate letters. Calling 'toUpperCase()' on an English string containing an 'i', when running in a Turkish locale, will return incorrect results. Alternatively, when dealing with strings that should be treated as locale-independent, like HTML tags, this can lead to errors. Inspection ID: StringToUpperWithoutLocale",
+ "markdown": "Reports `toUpperCase()` or `toLowerCase()` calls on `String` objects that do not specify a `java.util.Locale`. In these cases the default system locale is used, which can cause problems in an internationalized environment.\n\n\nFor example the code `\"i\".toUpperCase().equals(\"I\")` returns `false` in the Turkish and Azerbaijani locales, where\nthe dotted and dotless 'i' are separate letters. Calling `toUpperCase()` on an English string containing an 'i', when running\nin a Turkish locale, will return incorrect results. Alternatively, when dealing with strings that should be treated as locale-independent,\nlike HTML tags, this can lead to errors.\n\nInspection ID: StringToUpperWithoutLocale"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringToUpperCaseOrToLowerCaseWithoutLocale",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 7,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExplicitToImplicitClassMigration",
+ "shortDescription": {
+ "text": "Explicit class declaration can be converted into implicitly declared class"
+ },
+ "fullDescription": {
+ "text": "Reports ordinary classes, which can be converted into implicitly declared classes Example: 'public class Sample {\n public static void main(String[] args) {\n System.out.println(\"Hello, world!\");\n }\n }' After the quick-fix is applied: 'public static void main(String[] args) {\n System.out.println(\"Hello, world!\");\n }' This inspection depends on the Java feature 'Implicitly declared classes', which is available since Java 21-preview. Inspection ID: ExplicitToImplicitClassMigration New in 2024.1",
+ "markdown": "Reports ordinary classes, which can be converted into implicitly declared classes\n\n**Example:**\n\n\n public class Sample {\n public static void main(String[] args) {\n System.out.println(\"Hello, world!\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public static void main(String[] args) {\n System.out.println(\"Hello, world!\");\n }\n\nThis inspection depends on the Java feature 'Implicitly declared classes', which is available since Java 21-preview.\n\nInspection ID: ExplicitToImplicitClassMigration\n\nNew in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExplicitToImplicitClassMigration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 21",
+ "index": 211,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedMethodCall",
+ "shortDescription": {
+ "text": "Nested method call"
+ },
+ "fullDescription": {
+ "text": "Reports method calls used as parameters to another method call. The quick-fix introduces a variable to make the code simpler and easier to debug. Example: 'public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int x = f(y());\n }' After the quick-fix is applied: 'public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int y = y();\n int x = f(y);\n }' Use the inspection options to toggle the reporting of: method calls in field initializers calls to static methods calls to simple getters Inspection ID: NestedMethodCall",
+ "markdown": "Reports method calls used as parameters to another method call.\n\nThe quick-fix introduces a variable to make the code simpler and easier to debug.\n\n**Example:**\n\n\n public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int x = f(y());\n }\n\nAfter the quick-fix is applied:\n\n\n public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int y = y();\n int x = f(y);\n }\n\n\nUse the inspection options to toggle the reporting of:\n\n* method calls in field initializers\n* calls to static methods\n* calls to simple getters\n\nInspection ID: NestedMethodCall"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedMethodCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithTooManyTransitiveDependents",
+ "shortDescription": {
+ "text": "Class with too many transitive dependents"
+ },
+ "fullDescription": {
+ "text": "Reports a class on which too many other classes are directly or indirectly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the Maximum number of transitive dependents field to specify the maximum allowed number of direct or indirect dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassWithTooManyTransitiveDependents",
+ "markdown": "Reports a class on which too many other classes are directly or indirectly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependents** field to specify the maximum allowed number of direct or indirect dependents\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassWithTooManyTransitiveDependents"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyTransitiveDependents",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 152,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CompareToUsesNonFinalVariable",
+ "shortDescription": {
+ "text": "Non-final field referenced in 'compareTo()'"
+ },
+ "fullDescription": {
+ "text": "Reports access to a non-'final' field inside a 'compareTo()' implementation. Such access may result in 'compareTo()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes, for example 'java.util.TreeSet'. A quick-fix to make the field 'final' is available only when there is no write access to the field, otherwise no fixes are suggested. Example: 'class Foo implements Comparable{\n private int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }' After the quick-fix is applied: 'class Foo implements Comparable{\n private final int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }' Inspection ID: CompareToUsesNonFinalVariable",
+ "markdown": "Reports access to a non-`final` field inside a `compareTo()` implementation.\n\n\nSuch access may result in `compareTo()`\nreturning different results at different points in the object's lifecycle, which may in turn cause problems when\nusing the standard collections classes, for example `java.util.TreeSet`.\n\n\nA quick-fix to make the field `final` is available\nonly when there is no write access to the field, otherwise no fixes are suggested.\n\n**Example:**\n\n\n class Foo implements Comparable{\n private int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Comparable{\n private final int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }\n\nInspection ID: CompareToUsesNonFinalVariable"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CompareToUsesNonFinalVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavacQuirks",
+ "shortDescription": {
+ "text": "Javac quirks"
+ },
+ "fullDescription": {
+ "text": "Reports known Javac issues, performance problems, and incompatibilities. For example, type inference may be slow when it has to process many nested calls. The following code triggers a warning, as the vararg method call has 50+ poly arguments: 'Arrays.asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));' The quick-fix adds explicit type arguments, which makes compilation and IDE processing much faster: '//noinspection RedundantTypeArguments\n Arrays.>asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));' Inspection ID: JavacQuirks",
+ "markdown": "Reports known Javac issues, performance problems, and incompatibilities. For example, type inference may be slow when it has to process many nested calls.\n\nThe following code triggers a warning, as the vararg method call has 50+ poly arguments:\n\n\n Arrays.asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));\n\nThe quick-fix adds explicit type arguments, which makes compilation and IDE processing much faster:\n\n\n //noinspection RedundantTypeArguments\n Arrays.>asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));\n\nInspection ID: JavacQuirks"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavacQuirks",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Performance"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Compiler issues",
+ "index": 171,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchStatement",
+ "shortDescription": {
+ "text": "'switch' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements. 'switch' statements often (but not always) indicate a poor object-oriented design. Example: 'switch (i) {\n // code\n }' Inspection ID: SwitchStatement",
+ "markdown": "Reports `switch` statements.\n\n`switch` statements often (but not always) indicate a poor object-oriented design.\n\nExample:\n\n\n switch (i) {\n // code\n }\n\nInspection ID: SwitchStatement"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SwitchStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringBufferReplaceableByString",
+ "shortDescription": {
+ "text": "'StringBuilder' can be replaced with 'String'"
+ },
+ "fullDescription": {
+ "text": "Reports usages of 'StringBuffer', 'StringBuilder', or 'StringJoiner' which can be replaced with a single 'String' concatenation. Using 'String' concatenation makes the code shorter and simpler. This inspection only reports when the suggested replacement does not result in significant performance drawback on modern JVMs. In many cases, 'String' concatenation may perform better. Example: 'StringBuilder result = new StringBuilder();\n result.append(\"i = \");\n result.append(i);\n result.append(\";\");\n return result.toString();' After the quick-fix is applied: 'String result = \"i = \" + i + \";\";\n return result;' Inspection ID: StringBufferReplaceableByString",
+ "markdown": "Reports usages of `StringBuffer`, `StringBuilder`, or `StringJoiner` which can be replaced with a single `String` concatenation.\n\nUsing `String` concatenation\nmakes the code shorter and simpler.\n\n\nThis inspection only reports when the suggested replacement does not result in significant\nperformance drawback on modern JVMs. In many cases, `String` concatenation may perform better.\n\n**Example:**\n\n\n StringBuilder result = new StringBuilder();\n result.append(\"i = \");\n result.append(i);\n result.append(\";\");\n return result.toString();\n\nAfter the quick-fix is applied:\n\n\n String result = \"i = \" + i + \";\";\n return result;\n\nInspection ID: StringBufferReplaceableByString"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringBufferReplaceableByString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SourceToSinkFlow",
+ "shortDescription": {
+ "text": "Non-safe string is passed to safe method"
+ },
+ "fullDescription": {
+ "text": "Reports cases when a non-safe object is passed to a method with a parameter marked with '@Untainted' annotations, returned from annotated methods or assigned to annotated fields, parameters, or local variables. Kotlin 'set' and 'get' methods for fields are not supported as entry points. A safe object (in the same class) is: a string literal, interface instance, or enum object a result of a call of a method that is marked as '@Untainted' a private field, which is assigned only with a string literal and has a safe initializer a final field, which has a safe initializer local variable or parameter that are marked as '@Untainted' and are not assigned from non-safe objects This field, local variable, or parameter must not be passed as arguments to methods or used as a qualifier or must be a primitive, its wrapper or immutable. Also static final fields are considered as safe. The analysis is performed only inside one file. To process dependencies from other classes, use options. The analysis extends to private or static methods and has a limit of depth propagation. Example: 'void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n if (b) s1 = s;\n sink(s);\n }\n\n String sink(@Untainted String s) {}'\n Here we do not have non-safe string assignments to 's' so a warning is not produced. On the other hand: 'void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n s1 = foo();\n if (b) s = s1;\n sink(s); // warning here\n }\n\n String foo();\n\n String sink(@Untainted String s) {}'\n Here we have a warning since 's1' has an unknown state after 'foo' call result assignment. Inspection ID: SourceToSinkFlow New in 2021.2",
+ "markdown": "Reports cases when a non-safe object is passed to a method with a parameter marked with `@Untainted` annotations, returned from annotated methods or assigned to annotated fields, parameters, or local variables. Kotlin `set` and `get` methods for fields are not supported as entry points.\n\n\nA safe object (in the same class) is:\n\n* a string literal, interface instance, or enum object\n* a result of a call of a method that is marked as `@Untainted`\n* a private field, which is assigned only with a string literal and has a safe initializer\n* a final field, which has a safe initializer\n* local variable or parameter that are marked as `@Untainted` and are not assigned from non-safe objects\nThis field, local variable, or parameter must not be passed as arguments to methods or used as a qualifier or must be a primitive, its wrapper or immutable.\n\nAlso static final fields are considered as safe.\n\n\nThe analysis is performed only inside one file. To process dependencies from other classes, use options.\nThe analysis extends to private or static methods and has a limit of depth propagation.\n\n\nExample:\n\n\n void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n if (b) s1 = s;\n sink(s);\n }\n\n String sink(@Untainted String s) {}\n\n\nHere we do not have non-safe string assignments to `s` so a warning is not produced. On the other hand:\n\n\n void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n s1 = foo();\n if (b) s = s1;\n sink(s); // warning here\n }\n\n String foo();\n\n String sink(@Untainted String s) {}\n\n\nHere we have a warning since `s1` has an unknown state after `foo` call result assignment.\n\nInspection ID: SourceToSinkFlow\n\nNew in 2021.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "tainting",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Security"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RecordCanBeClass",
+ "shortDescription": {
+ "text": "Record can be converted to class"
+ },
+ "fullDescription": {
+ "text": "Reports record classes and suggests converting them to ordinary classes. This inspection makes it possible to move a Java record to a codebase using an earlier Java version by applying the quick-fix to this record. Note that the resulting class is not completely equivalent to the original record: The resulting class no longer extends 'java.lang.Record', so 'instanceof Record' returns 'false'. Reflection methods like 'Class.isRecord()' and 'Class.getRecordComponents()' produce different results. The generated 'hashCode()' implementation may produce a different result because the formula to calculate record 'hashCode' is deliberately not specified. Record serialization mechanism differs from that of an ordinary class. Refer to Java Object Serialization Specification for details. Example: 'record Point(int x, int y) {}' After the quick-fix is applied: 'final class Point {\n private final int x;\n private final int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public int x() { return x; }\n\n public int y() { return y; }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == this) return true;\n if (obj == null || obj.getClass() != this.getClass()) return false;\n var that = (Point)obj;\n return this.x == that.x &&\n this.y == that.y;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(x, y);\n }\n\n @Override\n public String toString() {\n return \"Point[\" +\n \"x=\" + x + \", \" +\n \"y=\" + y + ']';\n }\n }' This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: RecordCanBeClass New in 2020.3",
+ "markdown": "Reports record classes and suggests converting them to ordinary classes.\n\nThis inspection makes it possible to move a Java record to a codebase using an earlier Java version\nby applying the quick-fix to this record.\n\n\nNote that the resulting class is not completely equivalent to the original record:\n\n* The resulting class no longer extends `java.lang.Record`, so `instanceof Record` returns `false`.\n* Reflection methods like `Class.isRecord()` and `Class.getRecordComponents()` produce different results.\n* The generated `hashCode()` implementation may produce a different result because the formula to calculate record `hashCode` is deliberately not specified.\n* Record serialization mechanism differs from that of an ordinary class. Refer to *Java Object Serialization Specification* for details.\n\nExample:\n\n\n record Point(int x, int y) {}\n\nAfter the quick-fix is applied:\n\n\n final class Point {\n private final int x;\n private final int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public int x() { return x; }\n\n public int y() { return y; }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == this) return true;\n if (obj == null || obj.getClass() != this.getClass()) return false;\n var that = (Point)obj;\n return this.x == that.x &&\n this.y == that.y;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(x, y);\n }\n\n @Override\n public String toString() {\n return \"Point[\" +\n \"x=\" + x + \", \" +\n \"y=\" + y + ']';\n }\n }\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: RecordCanBeClass\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "RecordCanBeClass",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MalformedFormatString",
+ "shortDescription": {
+ "text": "Malformed format string"
+ },
+ "fullDescription": {
+ "text": "Reports format strings that don't comply with the standard Java syntax. By default, the inspection considers a compile-time constant a format string if it's used as an argument to the corresponding methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter' or 'java.io.PrintStream'. Example: 'String.format(\"x = %d, y = %d\", 42);' Use the inspection settings to mark additional classes and methods as related to string formatting. As an alternative, you can use the 'org.intellij.lang.annotations.PrintFormat' annotation to mark the format string method parameter. In this case, the format arguments parameter must immediately follow the format string and be the last method parameter. Example: 'void myFormatMethod(int mode, @PrintFormat String formatString, Object... args) {...}' Methods annotated in this way will also be recognized by this inspection. Inspection ID: MalformedFormatString",
+ "markdown": "Reports format strings that don't comply with the standard Java syntax.\n\nBy default, the inspection considers a compile-time constant a format string if it's used as an argument to the corresponding methods on\n`java.util.Formatter`, `java.lang.String`, `java.io.PrintWriter` or `java.io.PrintStream`.\n\n**Example:**\n\n\n String.format(\"x = %d, y = %d\", 42);\n\nUse the inspection settings to mark additional classes and methods as related to string formatting.\n\nAs an alternative, you can use the `org.intellij.lang.annotations.PrintFormat` annotation\nto mark the format string method parameter. In this case,\nthe format arguments parameter must immediately follow the format string and be the last method parameter. Example:\n\n\n void myFormatMethod(int mode, @PrintFormat String formatString, Object... args) {...}\n\n\nMethods annotated in this way will also be recognized by this inspection.\n\nInspection ID: MalformedFormatString"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MalformedFormatString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadYield",
+ "shortDescription": {
+ "text": "Call to 'Thread.yield()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Thread.yield()'. The behavior of 'yield()' is non-deterministic and platform-dependent, and it is rarely appropriate to use this method. Its use should be combined with detailed profiling and benchmarking to ensure that it actually has the desired effect. Example: 'public static void main(String[] args) {\n Runnable r = () -> {\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n Thread.yield();\n }\n };\n new Thread(r).start();\n new Thread(r).start();\n }' Inspection ID: ThreadYield",
+ "markdown": "Reports calls to `Thread.yield()`.\n\n\nThe behavior of `yield()` is non-deterministic and platform-dependent, and it is rarely appropriate to use this method.\nIts use should be combined with detailed profiling and benchmarking to ensure that it actually has the desired effect.\n\n**Example:**\n\n\n public static void main(String[] args) {\n Runnable r = () -> {\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n Thread.yield();\n }\n };\n new Thread(r).start();\n new Thread(r).start();\n }\n\nInspection ID: ThreadYield"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadYield",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaCanBeMethodCall",
+ "shortDescription": {
+ "text": "Lambda can be replaced with method call"
+ },
+ "fullDescription": {
+ "text": "Reports lambda expressions which can be replaced with a call to a JDK method. For example, an expression 'x -> x' of type 'Function' can be replaced with a 'Function.identity()' call. This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaCanBeMethodCall New in 2017.1",
+ "markdown": "Reports lambda expressions which can be replaced with a call to a JDK method.\n\nFor example, an expression `x -> x` of type `Function`\ncan be replaced with a `Function.identity()` call.\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaCanBeMethodCall\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LambdaCanBeMethodCall",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EndlessStream",
+ "shortDescription": {
+ "text": "Non-short-circuit operation consumes infinite stream"
+ },
+ "fullDescription": {
+ "text": "Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception. Example: 'Stream.iterate(0, i -> i + 1).collect(Collectors.toList())' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: EndlessStream",
+ "markdown": "Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception.\n\nExample:\n\n\n Stream.iterate(0, i -> i + 1).collect(Collectors.toList())\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: EndlessStream"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EndlessStream",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalUtilityClass",
+ "shortDescription": {
+ "text": "Utility class is not 'final'"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes that aren't 'final' or 'abstract'. Utility classes have all fields and methods declared as 'static'. Making them 'final' prevents them from being accidentally subclassed. Example: 'public class UtilityClass {\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n public static void foo() {}\n }' Inspection ID: NonFinalUtilityClass",
+ "markdown": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n\nInspection ID: NonFinalUtilityClass"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalUtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Singleton",
+ "shortDescription": {
+ "text": "Singleton"
+ },
+ "fullDescription": {
+ "text": "Reports singleton classes. Singleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing, and their presence may indicate a lack of object-oriented design. Example: 'class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }' Inspection ID: Singleton",
+ "markdown": "Reports singleton classes.\n\nSingleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing,\nand their presence may indicate a lack of object-oriented design.\n\n**Example:**\n\n\n class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }\n\nInspection ID: Singleton"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Singleton",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FuseStreamOperations",
+ "shortDescription": {
+ "text": "Subsequent steps can be fused into Stream API chain"
+ },
+ "fullDescription": {
+ "text": "Detects transformations outside a Stream API chain that could be incorporated into it. Example: 'List list = stream.collect(Collectors.toList());\n list.sort(null);\n return list.toArray(new String[list.size()]);' After the conversion: 'return stream.sorted().toArray(String[]::new);' Note that sometimes the converted stream chain may replace explicit 'ArrayList' with 'Collectors.toList()' or explicit 'HashSet' with 'Collectors.toSet()'. The current library implementation uses these collections internally. However, this approach is not very reliable and might change in the future altering the semantics of your code. If you are concerned about it, use the Do not suggest 'toList()' or 'toSet()' collectors option to suggest 'Collectors.toCollection()' instead of 'toList' and 'toSet' collectors. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: FuseStreamOperations",
+ "markdown": "Detects transformations outside a Stream API chain that could be incorporated into it.\n\nExample:\n\n\n List list = stream.collect(Collectors.toList());\n list.sort(null);\n return list.toArray(new String[list.size()]);\n\nAfter the conversion:\n\n\n return stream.sorted().toArray(String[]::new);\n\n\nNote that sometimes the converted stream chain may replace explicit `ArrayList` with `Collectors.toList()` or explicit\n`HashSet` with `Collectors.toSet()`. The current library implementation uses these collections internally. However,\nthis approach is not very reliable and might change in the future altering the semantics of your code.\n\nIf you are concerned about it, use the **Do not suggest 'toList()' or 'toSet()' collectors** option to suggest\n`Collectors.toCollection()` instead of `toList` and `toSet` collectors.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: FuseStreamOperations"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FuseStreamOperations",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DefaultNotLastCaseInSwitch",
+ "shortDescription": {
+ "text": "'default' not last case in 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements or expressions in which the 'default' branch is positioned before another case. Such a construct is unnecessarily confusing. A quick-fix is provided to move the 'default' branch to the last position, if possible. Example: 'switch (n) {\n default:\n System.out.println();\n break;\n case 1:\n break;\n }' After the quick-fix is applied: 'switch (n) {\n case 1:\n break;\n default:\n System.out.println();\n break;\n }' Inspection ID: DefaultNotLastCaseInSwitch",
+ "markdown": "Reports `switch` statements or expressions in which the `default` branch is positioned before another case. Such a construct is unnecessarily confusing. A quick-fix is provided to move the `default` branch to the last position, if possible.\n\n**Example:**\n\n\n switch (n) {\n default:\n System.out.println();\n break;\n case 1:\n break;\n }\n\nAfter the quick-fix is applied:\n\n\n switch (n) {\n case 1:\n break;\n default:\n System.out.println();\n break;\n }\n\n\nInspection ID: DefaultNotLastCaseInSwitch"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DefaultNotLastCaseInSwitch",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NullThrown",
+ "shortDescription": {
+ "text": "'null' thrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'null' literals that are used as the argument of a 'throw' statement. Such constructs produce a 'java.lang.NullPointerException' that usually should not be thrown programmatically. Inspection ID: NullThrown",
+ "markdown": "Reports `null` literals that are used as the argument of a `throw` statement.\n\nSuch constructs produce a `java.lang.NullPointerException` that usually should not be thrown programmatically.\n\nInspection ID: NullThrown"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NullThrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LocalCanBeFinal",
+ "shortDescription": {
+ "text": "Local variable or parameter can be 'final'"
+ },
+ "fullDescription": {
+ "text": "Reports parameters or local variables that may have the 'final' modifier added to their declaration. Example: 'ArrayList list = new ArrayList();\n fill(list);\n return list;' After the quick-fix is applied: 'final ArrayList list = new ArrayList();\n fill(list);\n return list;' Use the inspection's options to define whether parameters or local variables should be reported. Inspection ID: LocalCanBeFinal",
+ "markdown": "Reports parameters or local variables that may have the `final` modifier added to their declaration.\n\nExample:\n\n\n ArrayList list = new ArrayList();\n fill(list);\n return list;\n\nAfter the quick-fix is applied:\n\n\n final ArrayList list = new ArrayList();\n fill(list);\n return list;\n\n\nUse the inspection's options to define whether parameters or local variables should be reported.\n\nInspection ID: LocalCanBeFinal"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LocalCanBeFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldMayBeStatic",
+ "shortDescription": {
+ "text": "Field can be made 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports instance variables that can safely be made 'static'. A field can be static if it is declared 'final' and initialized with a constant. Example: 'public final String str = \"sample\";' The inspection does not report final fields that can be implicitly written. Use the \"Annotations\" button to modify the list of annotations that assume implicit field write. Inspection ID: FieldMayBeStatic",
+ "markdown": "Reports instance variables that can safely be made `static`. A field can be static if it is declared `final` and initialized with a constant.\n\n**Example:**\n\n\n public final String str = \"sample\";\n\n\nThe inspection does not report final fields that can be implicitly written. Use the \"Annotations\" button to modify\nthe list of annotations that assume implicit field write.\n\nInspection ID: FieldMayBeStatic"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayEquals",
+ "shortDescription": {
+ "text": "'equals()' called on array"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' calls that compare two arrays. Calling 'equals()' on an array compares identity and is equivalent to using '=='. Use 'Arrays.equals()' to compare the contents of two arrays, or 'Arrays.deepEquals()' for multi-dimensional arrays. Example: 'void sample(int[] first, int[] second){\n if (first.equals(second)) return;\n }' After the quick-fix is applied: 'void sample(int[] first, int[] second){\n if (Arrays.equals(first, second)) return;\n }' Inspection ID: ArrayEquals",
+ "markdown": "Reports `equals()` calls that compare two arrays.\n\nCalling `equals()` on an array compares identity and is equivalent to using `==`.\nUse `Arrays.equals()` to compare the contents of two arrays, or `Arrays.deepEquals()` for\nmulti-dimensional arrays.\n\n**Example:**\n\n\n void sample(int[] first, int[] second){\n if (first.equals(second)) return;\n }\n\nAfter the quick-fix is applied:\n\n\n void sample(int[] first, int[] second){\n if (Arrays.equals(first, second)) return;\n }\n\nInspection ID: ArrayEquals"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayEquals",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ProblematicVarargsMethodOverride",
+ "shortDescription": {
+ "text": "Non-varargs method overrides varargs method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that override a variable arity (a.k.a. varargs) method but replace the variable arity parameter with an array parameter. Though this code is valid, it may be confusing and should be avoided. Inspection ID: ProblematicVarargsMethodOverride",
+ "markdown": "Reports methods that override a variable arity (a.k.a. varargs) method but replace the variable arity parameter with an array parameter. Though this code is valid, it may be confusing and should be avoided.\n\n\nInspection ID: ProblematicVarargsMethodOverride"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProblematicVarargsMethodOverride",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisspelledHeader",
+ "shortDescription": {
+ "text": "Unknown or misspelled header name"
+ },
+ "fullDescription": {
+ "text": "Reports any unknown and probably misspelled header names and provides possible variants. Inspection ID: MisspelledHeader",
+ "markdown": "Reports any unknown and probably misspelled header names and provides possible variants.\n\nInspection ID: MisspelledHeader"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MisspelledHeader",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Code Style"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Manifest",
+ "index": 118,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AtomicFieldUpdaterIssues",
+ "shortDescription": {
+ "text": "Inconsistent 'AtomicFieldUpdater' declaration"
+ },
+ "fullDescription": {
+ "text": "Reports issues with 'AtomicLongFieldUpdater', 'AtomicIntegerFieldUpdater', or 'AtomicReferenceFieldUpdater' fields (the 'java.util.concurrent.atomic' package). The reported issues are identical to the runtime problems that can happen with atomic field updaters: specified field not found, specified field not accessible, specified field has a wrong type, and so on. Examples: 'class A {\n private static volatile int value = 0;\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater((A.class), \"value\"); // warning: Field 'value' has 'static' modifier\n }' 'class B {\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater(B.class, \"value\"); // warning: No field named 'value' found in class 'B'\n }' Inspection ID: AtomicFieldUpdaterIssues",
+ "markdown": "Reports issues with `AtomicLongFieldUpdater`, `AtomicIntegerFieldUpdater`, or `AtomicReferenceFieldUpdater` fields (the `java.util.concurrent.atomic` package).\n\nThe reported issues are identical to the runtime problems that can happen with atomic field updaters:\nspecified field not found, specified field not accessible, specified field has a wrong type, and so on.\n\n**Examples:**\n\n*\n\n\n class A {\n private static volatile int value = 0;\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater((A.class), \"value\"); // warning: Field 'value' has 'static' modifier\n }\n \n*\n\n\n class B {\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater(B.class, \"value\"); // warning: No field named 'value' found in class 'B'\n }\n \n\nInspection ID: AtomicFieldUpdaterIssues"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AtomicFieldUpdaterIssues",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageNamingConvention",
+ "shortDescription": {
+ "text": "Package naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports packages whose names are either too short, too long, or do not follow the specified regular expression pattern. Example: 'package io;' Use the options to specify the minimum and maximum length of the package name as well as a regular expression that matches valid package names (regular expressions are in standard 'java.util.regex' format). Inspection ID: PackageNamingConvention",
+ "markdown": "Reports packages whose names are either too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:**\n\n\n package io;\n\n\nUse the options to specify the minimum and maximum length of the package name\nas well as a regular expression that matches valid package names\n(regular expressions are in standard `java.util.regex` format).\n\nInspection ID: PackageNamingConvention"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThrowableNotThrown",
+ "shortDescription": {
+ "text": "'Throwable' not thrown"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of 'Throwable' or its subclasses, where the created 'Throwable' is never actually thrown. Additionally, this inspection reports method calls that return instances of 'Throwable' or its subclasses, when the result of the method call is not thrown. Calls to methods annotated with the Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. Example: 'void check(String s) {\n if (s == null) {\n new NullPointerException(\"s\");\n }\n // ...\n }' Inspection ID: ThrowableNotThrown",
+ "markdown": "Reports instantiations of `Throwable` or its subclasses, where the created `Throwable` is never actually thrown. Additionally, this inspection reports method calls that return instances of `Throwable` or its subclasses, when the result of the method call is not thrown.\n\nCalls to methods annotated with the Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\n\n**Example:**\n\n\n void check(String s) {\n if (s == null) {\n new NullPointerException(\"s\");\n }\n // ...\n }\n\nInspection ID: ThrowableNotThrown"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThrowableNotThrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CapturingCleaner",
+ "shortDescription": {
+ "text": "Cleaner captures object reference"
+ },
+ "fullDescription": {
+ "text": "Reports 'Runnable' passed to a 'Cleaner.register()' capturing reference being registered. If the reference is captured, it will never be phantom reachable and the cleaning action will never be invoked. Possible sources of this problem: Lambda using non-static methods, fields, or 'this' itself Non-static inner class (anonymous or not) always captures this reference in java up to 18 version Instance method reference Access to outer class non-static members from non-static inner class Sample of code that will be reported: 'int fileDescriptor;\n Cleaner.Cleanable cleanable = Cleaner.create().register(this, () -> {\n System.out.println(\"adsad\");\n //this is captured via fileDescriptor\n fileDescriptor = 0;\n });' This inspection only reports if the language level of the project or module is 9 or higher. Inspection ID: CapturingCleaner New in 2018.1",
+ "markdown": "Reports `Runnable` passed to a `Cleaner.register()` capturing reference being registered. If the reference is captured, it will never be phantom reachable and the cleaning action will never be invoked.\n\nPossible sources of this problem:\n\n* Lambda using non-static methods, fields, or `this` itself\n* Non-static inner class (anonymous or not) always captures this reference in java up to 18 version\n* Instance method reference\n* Access to outer class non-static members from non-static inner class\n\nSample of code that will be reported:\n\n\n int fileDescriptor;\n Cleaner.Cleanable cleanable = Cleaner.create().register(this, () -> {\n System.out.println(\"adsad\");\n //this is captured via fileDescriptor\n fileDescriptor = 0;\n });\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nInspection ID: CapturingCleaner\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CapturingCleaner",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadStartInConstruction",
+ "shortDescription": {
+ "text": "Call to 'Thread.start()' during object construction"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'start()' on 'java.lang.Thread' or any of its subclasses during object construction. While occasionally useful, such constructs should be avoided due to inheritance issues. Subclasses of a class that launches a thread during the object construction will not have finished any initialization logic of their own before the thread has launched. This inspection does not report if the class that starts a thread is declared 'final'. Example: 'class MyThread extends Thread {\n MyThread() {\n start();\n }\n }' Inspection ID: ThreadStartInConstruction",
+ "markdown": "Reports calls to `start()` on `java.lang.Thread` or any of its subclasses during object construction.\n\n\nWhile occasionally useful, such constructs should be avoided due to inheritance issues.\nSubclasses of a class that launches a thread during the object construction will not have finished\nany initialization logic of their own before the thread has launched.\n\nThis inspection does not report if the class that starts a thread is declared `final`.\n\n**Example:**\n\n\n class MyThread extends Thread {\n MyThread() {\n start();\n }\n }\n\nInspection ID: ThreadStartInConstruction"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadStartDuringObjectConstruction",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchStatementWithTooManyBranches",
+ "shortDescription": {
+ "text": "Maximum 'switch' branches"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements or expressions with too many 'case' labels. Such a long switch statement may be confusing and should probably be refactored. Sometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants). Example: 'switch (x) {\n case 1 -> {}\n case 2 -> {}\n case 3 -> {}\n case 4 -> {}\n case 5 -> {}\n case 6 -> {}\n case 7 -> {}\n case 8 -> {}\n case 9 -> {}\n case 10 -> {}\n case 11,12,13 -> {}\n default -> {}\n }' Use the Maximum number of branches field to specify the maximum number of 'case' labels expected. Inspection ID: SwitchStatementWithTooManyBranches",
+ "markdown": "Reports `switch` statements or expressions with too many `case` labels.\n\nSuch a long switch statement may be confusing and should probably be refactored.\nSometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants).\n\nExample:\n\n\n switch (x) {\n case 1 -> {}\n case 2 -> {}\n case 3 -> {}\n case 4 -> {}\n case 5 -> {}\n case 6 -> {}\n case 7 -> {}\n case 8 -> {}\n case 9 -> {}\n case 10 -> {}\n case 11,12,13 -> {}\n default -> {}\n }\n\nUse the **Maximum number of branches** field to specify the maximum number of `case` labels expected.\n\n\nInspection ID: SwitchStatementWithTooManyBranches"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SwitchStatementWithTooManyBranches",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoopConditionNotUpdatedInsideLoop",
+ "shortDescription": {
+ "text": "Loop variable not updated inside loop"
+ },
+ "fullDescription": {
+ "text": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop. Such variables and parameters are usually used by mistake as they may cause an infinite loop if they are executed. Example: 'void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }' Configure the inspection: Use the Ignore possible non-local changes option to disable this inspection if the condition can be updated indirectly (e.g. via the called method or concurrently from another thread). Inspection ID: LoopConditionNotUpdatedInsideLoop",
+ "markdown": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop.\n\nSuch variables and parameters are usually used by mistake as they\nmay cause an infinite loop if they are executed.\n\nExample:\n\n\n void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore possible non-local changes** option to disable this inspection\nif the condition can be updated indirectly (e.g. via the called method or concurrently from another thread).\n\nInspection ID: LoopConditionNotUpdatedInsideLoop"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoopConditionNotUpdatedInsideLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DoubleCheckedLocking",
+ "shortDescription": {
+ "text": "Double-checked locking"
+ },
+ "fullDescription": {
+ "text": "Reports double-checked locking. Double-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization. Unfortunately it is not thread-safe when used on a field that is not declared 'volatile'. When using Java 1.4 or earlier, double-checked locking doesn't work even with a 'volatile' field. Read the article linked above for a detailed explanation of the problem. Example of incorrect double-checked locking: 'class Foo {\n private Helper helper = null;\n public Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) helper = new Helper();\n }\n return helper;\n }\n }\n // other functions and members...\n }' Inspection ID: DoubleCheckedLocking",
+ "markdown": "Reports [double-checked locking](https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html).\n\n\nDouble-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization.\nUnfortunately it is not thread-safe when used on a field that is not declared `volatile`.\nWhen using Java 1.4 or earlier, double-checked locking doesn't work even with a `volatile` field.\nRead the article linked above for a detailed explanation of the problem.\n\nExample of incorrect double-checked locking:\n\n\n class Foo {\n private Helper helper = null;\n public Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) helper = new Helper();\n }\n return helper;\n }\n }\n // other functions and members...\n }\n\nInspection ID: DoubleCheckedLocking"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DoubleCheckedLocking",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisspelledMethodName",
+ "shortDescription": {
+ "text": "Method names differing only by case"
+ },
+ "fullDescription": {
+ "text": "Reports cases in which multiple methods of a class have the names that differ only by case. Such names may be very confusing. Example: 'public int hashcode() { // reported, should be hashCode probably?\n return 0;\n }' A quick-fix that renames such methods is available only in the editor. Use the Ignore methods overriding/implementing a super method option to ignore methods overriding or implementing a method from the superclass. Inspection ID: MisspelledMethodName",
+ "markdown": "Reports cases in which multiple methods of a class have the names that differ only by case. Such names may be very confusing.\n\n**Example:**\n\n\n public int hashcode() { // reported, should be hashCode probably?\n return 0;\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nUse the **Ignore methods overriding/implementing a super method** option to ignore methods overriding or implementing a method from\nthe superclass.\n\n\nInspection ID: MisspelledMethodName"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodNamesDifferingOnlyByCase",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 108,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonSerializableObjectBoundToHttpSession",
+ "shortDescription": {
+ "text": "Non-serializable object bound to 'HttpSession'"
+ },
+ "fullDescription": {
+ "text": "Reports objects of classes not implementing 'java.io.Serializable' used as arguments to 'javax.servlet.http.HttpSession.setAttribute()' or 'javax.servlet.http.HttpSession.putValue()'. Such objects will not be serialized if the 'HttpSession' is passivated or migrated, and may result in difficult-to-diagnose bugs. This inspection assumes objects of the types 'java.util.Collection' and 'java.util.Map' to be 'Serializable', unless type parameters are non-'Serializable'. Example: 'void foo(HttpSession session) {\n session.setAttribute(\"foo\", new NonSerializable());\n }\n static class NonSerializable {}' Inspection ID: NonSerializableObjectBoundToHttpSession",
+ "markdown": "Reports objects of classes not implementing `java.io.Serializable` used as arguments to `javax.servlet.http.HttpSession.setAttribute()` or `javax.servlet.http.HttpSession.putValue()`.\n\n\nSuch objects will not be serialized if the `HttpSession` is passivated or migrated,\nand may result in difficult-to-diagnose bugs.\n\n\nThis inspection assumes objects of the types `java.util.Collection` and\n`java.util.Map` to be `Serializable`,\nunless type parameters are non-`Serializable`.\n\n**Example:**\n\n\n void foo(HttpSession session) {\n session.setAttribute(\"foo\", new NonSerializable());\n }\n static class NonSerializable {}\n\nInspection ID: NonSerializableObjectBoundToHttpSession"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonSerializableObjectBoundToHttpSession",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadLocalNotStaticFinal",
+ "shortDescription": {
+ "text": "'ThreadLocal' field not declared 'static final'"
+ },
+ "fullDescription": {
+ "text": "Reports fields of type 'java.lang.ThreadLocal' that are not declared 'static final'. In the most common case, a 'java.lang.ThreadLocal' instance associates state with a thread. A non-static non-final 'java.lang.ThreadLocal' field associates state with an instance-thread combination. This is usually unnecessary and quite often is a bug that can cause memory leaks and incorrect behavior. A quick-fix is suggested to make the field 'static final'. Example: 'private ThreadLocal tl = ThreadLocal.withInitial(() -> Boolean.TRUE);' Inspection ID: ThreadLocalNotStaticFinal",
+ "markdown": "Reports fields of type `java.lang.ThreadLocal` that are not declared `static final`.\n\n\nIn the most common case, a `java.lang.ThreadLocal` instance associates state with a thread.\nA non-static non-final `java.lang.ThreadLocal` field associates state with an instance-thread combination.\nThis is usually unnecessary and quite often is a bug that can cause memory leaks and incorrect behavior.\n\n\nA quick-fix is suggested to make the field `static final`.\n\n\n**Example:**\n\n\n private ThreadLocal tl = ThreadLocal.withInitial(() -> Boolean.TRUE);\n\nInspection ID: ThreadLocalNotStaticFinal"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThreadLocalNotStaticFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AccessStaticViaInstance",
+ "shortDescription": {
+ "text": "Access static member via instance reference"
+ },
+ "fullDescription": {
+ "text": "Reports references to 'static' methods and fields via a class instance rather than the class itself. Even though referring to static members via instance variables is allowed by The Java Language Specification, this makes the code confusing as the reader may think that the result of the method depends on the instance. The quick-fix replaces the instance variable with the class name. Example: 'String s1 = s.valueOf(0);' After the quick-fix is applied: 'String s = String.valueOf(0);' Inspection ID: AccessStaticViaInstance",
+ "markdown": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n\n\nInspection ID: AccessStaticViaInstance"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessStaticViaInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CallToNativeMethodWhileLocked",
+ "shortDescription": {
+ "text": "Call to a 'native' method while locked"
+ },
+ "fullDescription": {
+ "text": "Reports calls 'native' methods within a 'synchronized' block or method. When possible, it's better to keep calls to 'native' methods out of the synchronized context because such calls cause an expensive context switch and may lead to performance issues. Example: 'native void nativeMethod();\n\n void example(){\n synchronized (lock){\n nativeMethod();//warning\n }\n }' Inspection ID: CallToNativeMethodWhileLocked",
+ "markdown": "Reports calls `native` methods within a `synchronized` block or method.\n\n\nWhen possible, it's better to keep calls to `native` methods out of the synchronized context\nbecause such calls cause an expensive context switch and may lead to performance issues.\n\n**Example:**\n\n\n native void nativeMethod();\n\n void example(){\n synchronized (lock){\n nativeMethod();//warning\n }\n }\n\nInspection ID: CallToNativeMethodWhileLocked"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToNativeMethodWhileLocked",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Dependency",
+ "shortDescription": {
+ "text": "Illegal package dependencies"
+ },
+ "fullDescription": {
+ "text": "Reports illegal dependencies between scopes according to the dependency rules given. Dependency rules can be used to prohibit usage from a scope to another scope. Use the Configure dependency rules button below to customize validation rules. Inspection ID: Dependency",
+ "markdown": "Reports illegal dependencies between scopes according to the dependency rules given. Dependency rules can be used to prohibit usage from a scope to another scope.\n\nUse the **Configure dependency rules** button below to customize validation rules.\n\nInspection ID: Dependency"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "Dependency",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical",
+ "codeQualityCategory": "Sanity"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestingDepth",
+ "shortDescription": {
+ "text": "Overly nested method"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose body contain too deeply nested statements. Methods with too deep statement nesting may be confusing and are a good sign that refactoring may be necessary. Use the Nesting depth limit field to specify the maximum allowed nesting depth for a method. Inspection ID: NestingDepth",
+ "markdown": "Reports methods whose body contain too deeply nested statements.\n\nMethods with too deep statement\nnesting may be confusing and are a good sign that refactoring may be necessary.\n\nUse the **Nesting depth limit** field to specify the maximum allowed nesting depth for a method.\n\n\nInspection ID: NestingDepth"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyNestedMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 141,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WriteOnlyObject",
+ "shortDescription": {
+ "text": "Write-only object"
+ },
+ "fullDescription": {
+ "text": "Reports objects that are modified but never queried. The inspection relies on the method mutation contract, which could be inferred or pre-annotated for some library methods. This inspection does not report collections, maps, and string builders, as these types are reported by other more precise inspections. Example: 'AtomicReference ref = new AtomicReference<>();\n ref.set(\"hello\"); // ref is never used again' Use the Ignore impure constructors option to control whether to process objects created by constructor or method whose purity is not known. Unchecking the option may introduce some false-positives if the object reference is intentionally leaked during the construction. New in 2021.2 Inspection ID: WriteOnlyObject",
+ "markdown": "Reports objects that are modified but never queried.\n\nThe inspection relies on the method mutation contract, which could be inferred\nor pre-annotated for some library methods. This inspection does not report collections, maps, and string builders, as these types\nare reported by other more precise inspections.\n\nExample:\n\n\n AtomicReference ref = new AtomicReference<>();\n ref.set(\"hello\"); // ref is never used again\n\n\nUse the **Ignore impure constructors** option to control whether to process objects created by constructor or method whose purity is not known.\nUnchecking the option may introduce some false-positives if the object reference is intentionally leaked during the construction.\n**New in 2021.2**\n\nInspection ID: WriteOnlyObject"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WriteOnlyObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SocketResource",
+ "shortDescription": {
+ "text": "Socket opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports socket resources that are not safely closed. Socket resources reported by this inspection include 'java.net.Socket', 'java.net.DatagramSocket', and 'java.net.ServerSocket'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'byte[] getMessage(ServerSocket socket) throws IOException {\n Socket client = socket.accept(); //socket is not closed\n return client.getInputStream().readAllBytes();\n }' Use the following options to configure the inspection: Whether a socket is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: SocketResource",
+ "markdown": "Reports socket resources that are not safely closed. Socket resources reported by this inspection include `java.net.Socket`, `java.net.DatagramSocket`, and `java.net.ServerSocket`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n byte[] getMessage(ServerSocket socket) throws IOException {\n Socket client = socket.accept(); //socket is not closed\n return client.getInputStream().readAllBytes();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a socket is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: SocketResource"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SocketOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 142,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TypeParameterHidesVisibleType",
+ "shortDescription": {
+ "text": "Type parameter hides visible type"
+ },
+ "fullDescription": {
+ "text": "Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing. Example: 'abstract class MyList extends AbstractList {\n private List elements;\n // type parameter 'T' hides type parameter 'T'\n public T[] toArray(T[] array) {\n return elements.toArray(array);\n }\n}' Inspection ID: TypeParameterHidesVisibleType",
+ "markdown": "Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing.\n\nExample:\n\n\n abstract class MyList extends AbstractList {\n private List elements;\n // type parameter 'T' hides type parameter 'T'\n public T[] toArray(T[] array) {\n return elements.toArray(array);\n }\n }\n\nInspection ID: TypeParameterHidesVisibleType"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TypeParameterHidesVisibleType",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 98,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MaskedAssertion",
+ "shortDescription": {
+ "text": "Assertion is suppressed by 'catch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'assert' statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown 'AssertionError' will be caught and silently ignored. Example 1: 'void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 2: '@Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 3: '@Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Inspection ID: MaskedAssertion New in 2020.3",
+ "markdown": "Reports `assert` statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown `AssertionError` will be caught and silently ignored.\n\n**Example 1:**\n\n\n void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 2:**\n\n\n @Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 3:**\n\n\n @Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\nInspection ID: MaskedAssertion\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MaskedAssertion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 133,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringTokenizerDelimiter",
+ "shortDescription": {
+ "text": "Duplicated delimiters in 'StringTokenizer'"
+ },
+ "fullDescription": {
+ "text": "Reports 'StringTokenizer()' constructor calls or 'nextToken()' method calls that contain duplicate characters in the delimiter argument. Example: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' After the quick-fix is applied: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' Inspection ID: StringTokenizerDelimiter",
+ "markdown": "Reports `StringTokenizer()` constructor calls or `nextToken()` method calls that contain duplicate characters in the delimiter argument.\n\n**Example:**\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nInspection ID: StringTokenizerDelimiter"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringTokenizerDelimiter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReflectionForUnavailableAnnotation",
+ "shortDescription": {
+ "text": "Reflective access to a source-only annotation"
+ },
+ "fullDescription": {
+ "text": "Reports attempts to reflectively check for the presence of a non-runtime annotation. Using 'Class.isAnnotationPresent()' to test for an annotation whose retention policy is set to 'SOURCE' or 'CLASS' (the default) will always have a negative result. This mistake is easy to overlook. Example: '{\n getClass().isAnnotationPresent(SourceAnnotation.class); //always false\n }\n\n @Retention(RetentionPolicy.SOURCE)\n @interface SourceAnnotation {}' This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: ReflectionForUnavailableAnnotation",
+ "markdown": "Reports attempts to reflectively check for the presence of a non-runtime annotation.\n\nUsing `Class.isAnnotationPresent()` to test for an annotation\nwhose retention policy is set to `SOURCE` or `CLASS`\n(the default) will always have a negative result. This mistake is easy to overlook.\n\n**Example:**\n\n\n {\n getClass().isAnnotationPresent(SourceAnnotation.class); //always false\n }\n\n @Retention(RetentionPolicy.SOURCE)\n @interface SourceAnnotation {}\n\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: ReflectionForUnavailableAnnotation"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReflectionForUnavailableAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstantiatingObjectToGetClassObject",
+ "shortDescription": {
+ "text": "Instantiating object to get 'Class' object"
+ },
+ "fullDescription": {
+ "text": "Reports code that instantiates a class to get its class object. It is more performant to access the class object directly by name. Example: 'Class> c = new Sample().getClass();' After the quick-fix is applied: 'Class> c = Sample.class;' Inspection ID: InstantiatingObjectToGetClassObject",
+ "markdown": "Reports code that instantiates a class to get its class object.\n\nIt is more performant to access the class object\ndirectly by name.\n\n**Example:**\n\n\n Class> c = new Sample().getClass();\n\nAfter the quick-fix is applied:\n\n\n Class> c = Sample.class;\n\nInspection ID: InstantiatingObjectToGetClassObject"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstantiatingObjectToGetClassObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ShiftOutOfRange",
+ "shortDescription": {
+ "text": "Shift operation by inappropriate constant"
+ },
+ "fullDescription": {
+ "text": "Reports shift operations where the shift value is a constant outside the reasonable range. Integer shift operations outside the range '0..31' and long shift operations outside the range '0..63' are reported. Shifting by negative or overly large values is almost certainly a coding error. Example: 'int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;' Inspection ID: ShiftOutOfRange",
+ "markdown": "Reports shift operations where the shift value is a constant outside the reasonable range.\n\nInteger shift operations outside the range `0..31` and long shift operations outside the\nrange `0..63` are reported. Shifting by negative or overly large values is almost certainly\na coding error.\n\n**Example:**\n\n\n int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;\n\nInspection ID: ShiftOutOfRange"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ShiftOutOfRange",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Bitwise operation issues",
+ "index": 216,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithMultipleLoggers",
+ "shortDescription": {
+ "text": "Class with multiple loggers"
+ },
+ "fullDescription": {
+ "text": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application. For example: 'public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }' Use the table below to specify Logger class names. Classes which declare multiple fields that have the type of one of the specified classes will be reported by this inspection. Inspection ID: ClassWithMultipleLoggers",
+ "markdown": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection.\n\n\nInspection ID: ClassWithMultipleLoggers"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithMultipleLoggers",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 120,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadRun",
+ "shortDescription": {
+ "text": "Call to 'Thread.run()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'run()' on 'java.lang.Thread' or any of its subclasses. While occasionally intended, this is usually a mistake, because 'run()' doesn't start a new thread. To execute the code in a separate thread, 'start()' should be used. Inspection ID: ThreadRun",
+ "markdown": "Reports calls to `run()` on `java.lang.Thread` or any of its subclasses.\n\n\nWhile occasionally intended, this is usually a mistake, because `run()` doesn't start a new thread.\nTo execute the code in a separate thread, `start()` should be used.\n\n\nInspection ID: ThreadRun"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadRun",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Reliability"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsThrowable",
+ "shortDescription": {
+ "text": "Class directly extends 'Throwable'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'' Inspection ID: ExtendsThrowable",
+ "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n\nInspection ID: ExtendsThrowable"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExtendsThrowable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AutoBoxing",
+ "shortDescription": {
+ "text": "Auto-boxing"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: AutoBoxing",
+ "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: AutoBoxing"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AutoBoxing",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceNeverImplemented",
+ "shortDescription": {
+ "text": "Interface which has no concrete subclass"
+ },
+ "fullDescription": {
+ "text": "Reports interfaces that have no concrete subclasses. Configure the inspection: Use the list below to add annotations. Interfaces declared with one of these annotations will be ignored by the inspection. Use the checkbox below to ignore interfaces that only declare constant fields. Such interfaces may still be usable even without implementations. Inspection ID: InterfaceNeverImplemented",
+ "markdown": "Reports interfaces that have no concrete subclasses.\n\nConfigure the inspection:\n\n* Use the list below to add annotations. Interfaces declared with one of these annotations will be ignored by the inspection.\n* Use the checkbox below to ignore interfaces that only declare constant fields. Such interfaces may still be usable even without implementations.\n\nInspection ID: InterfaceNeverImplemented"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceNeverImplemented",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadDeathRethrown",
+ "shortDescription": {
+ "text": "'ThreadDeath' not rethrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'try' statements that catch 'java.lang.ThreadDeath' and do not rethrow the exception. Example: 'try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }' Inspection ID: ThreadDeathRethrown",
+ "markdown": "Reports `try` statements that catch `java.lang.ThreadDeath` and do not rethrow the exception.\n\n**Example:**\n\n\n try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }\n\nInspection ID: ThreadDeathRethrown"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThreadDeathNotRethrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryModuleDependencyInspection",
+ "shortDescription": {
+ "text": "Unnecessary module dependency"
+ },
+ "fullDescription": {
+ "text": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies. Inspection ID: UnnecessaryModuleDependencyInspection",
+ "markdown": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies.\n\nInspection ID: UnnecessaryModuleDependencyInspection"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryModuleDependencyInspection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CloneCallsConstructors",
+ "shortDescription": {
+ "text": "'clone()' instantiates objects with constructor"
+ },
+ "fullDescription": {
+ "text": "Reports calls to object constructors inside 'clone()' methods. It is considered good practice to call 'clone()' to instantiate objects inside of a 'clone()' method instead of creating them directly to support later subclassing. This inspection will not report 'clone()' methods declared as 'final' or 'clone()' methods on 'final' classes. Inspection ID: CloneCallsConstructors",
+ "markdown": "Reports calls to object constructors inside `clone()` methods.\n\nIt is considered good practice to call `clone()` to instantiate objects inside of a `clone()` method\ninstead of creating them directly to support later subclassing.\nThis inspection will not report\n`clone()` methods declared as `final`\nor `clone()` methods on `final` classes.\n\nInspection ID: CloneCallsConstructors"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CloneCallsConstructors",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 117,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArraysAsListWithZeroOrOneArgument",
+ "shortDescription": {
+ "text": "Call to 'Arrays.asList()' with too few arguments"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Arrays.asList()' with at most one argument. Such calls could be replaced with 'Collections.singletonList()', 'Collections.emptyList()', or 'List.of()' on JDK 9 and later, which will save some memory. In particular, 'Collections.emptyList()' and 'List.of()' with no arguments always return a shared instance, while 'Arrays.asList()' with no arguments creates a new object every time it's called. Note: the lists returned by 'Collections.singletonList()' and 'List.of()' are immutable, while the list returned 'Arrays.asList()' allows calling the 'set()' method. This may break the code in rare cases. Example: 'List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");' After the quick-fix is applied: 'List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");' Inspection ID: ArraysAsListWithZeroOrOneArgument",
+ "markdown": "Reports calls to `Arrays.asList()` with at most one argument.\n\n\nSuch calls could be replaced\nwith `Collections.singletonList()`, `Collections.emptyList()`,\nor `List.of()` on JDK 9 and later, which will save some memory.\n\nIn particular, `Collections.emptyList()` and `List.of()` with no arguments\nalways return a shared instance,\nwhile `Arrays.asList()` with no arguments creates a new object every time it's called.\n\nNote: the lists returned by `Collections.singletonList()` and `List.of()` are immutable,\nwhile the list returned `Arrays.asList()` allows calling the `set()` method.\nThis may break the code in rare cases.\n\n**Example:**\n\n\n List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");\n\nAfter the quick-fix is applied:\n\n\n List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");\n\n\nInspection ID: ArraysAsListWithZeroOrOneArgument"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArraysAsListWithZeroOrOneArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 8,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnstableApiUsage",
+ "shortDescription": {
+ "text": "Unstable API Usage"
+ },
+ "fullDescription": {
+ "text": "Reports usages of an API marked with one of the annotations as unstable. Such an API may be changed or removed in future versions, breaking the code that uses it. The annotations which are used to mark unstable APIs are shown in the list below. By default, the inspection ignores usages of unstable APIs if their declarations are located in sources of the same project. In such cases it'll be possible to update the usages when you change APIs. However, it may be inconvenient if the project is big, so one can switch off the Ignore API declared in this project option to report the usages of unstable APIs declared in both the project sources and libraries. Inspection ID: UnstableApiUsage",
+ "markdown": "Reports usages of an API marked with one of the annotations as unstable. Such an API may be changed or removed in future versions, breaking the code that uses it.\n\nThe annotations which are used to mark unstable APIs are shown in the list below.\n\nBy default, the inspection ignores usages of unstable APIs\nif their declarations are located in sources of the same project. In such cases it'll be possible to update the usages when you change APIs.\nHowever, it may be inconvenient if the project is big, so one can switch off the **Ignore API declared in this project** option to report\nthe usages of unstable APIs declared in both the project sources and libraries.\n\nInspection ID: UnstableApiUsage"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnstableApiUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Reliability"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaUnfriendlyMethodOverload",
+ "shortDescription": {
+ "text": "Lambda-unfriendly method overload"
+ },
+ "fullDescription": {
+ "text": "Reports overloaded methods that take functional interfaces with conflicting abstract method signatures. Such overloads introduce ambiguity and require callers to cast lambdas to a specific type or specify lambda parameter types explicitly. It is preferable to give the overloaded methods different names to eliminate ambiguity. Example: 'interface MyExecutor {\n void execute(Supplier> supplier);\n void execute(Callable> callable);\n }' Here, 'Supplier' and 'Callable' are functional interfaces whose single abstract methods do not take any parameters and return a non-void value. As a result, the type of the lambda cannot be inferred at the call site unless an explicit cast is used. Inspection ID: LambdaUnfriendlyMethodOverload",
+ "markdown": "Reports overloaded methods that take functional interfaces with conflicting abstract method signatures.\n\nSuch overloads introduce ambiguity and require callers to cast lambdas to a specific type or specify lambda parameter types explicitly.\nIt is preferable to give the overloaded methods different names to eliminate ambiguity.\n\nExample:\n\n\n interface MyExecutor {\n void execute(Supplier> supplier);\n void execute(Callable> callable);\n }\n\n\nHere, `Supplier` and `Callable` are functional interfaces\nwhose single abstract methods do not take any parameters and return a non-void value.\nAs a result, the type of the lambda cannot be inferred at the call site unless an explicit cast is used.\n\nInspection ID: LambdaUnfriendlyMethodOverload"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LambdaUnfriendlyMethodOverload",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 108,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableRecordContainsIgnoredMembers",
+ "shortDescription": {
+ "text": "'record' contains ignored members"
+ },
+ "fullDescription": {
+ "text": "Reports serialization methods or fields defined in a 'record' class. Serialization methods include 'writeObject()', 'readObject()', 'readObjectNoData()', 'writeExternal()', and 'readExternal()' and the field 'serialPersistentFields'. These members are not used for the serialization or deserialization of records and therefore unnecessary. Examples: 'record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }' 'record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }' This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: SerializableRecordContainsIgnoredMembers New in 2020.3",
+ "markdown": "Reports serialization methods or fields defined in a `record` class. Serialization methods include `writeObject()`, `readObject()`, `readObjectNoData()`, `writeExternal()`, and `readExternal()` and the field `serialPersistentFields`. These members are not used for the serialization or deserialization of records and therefore unnecessary.\n\n**Examples:**\n\n\n record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n\n record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: SerializableRecordContainsIgnoredMembers\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableRecordContainsIgnoredMembers",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarilyQualifiedInnerClassAccess",
+ "shortDescription": {
+ "text": "Unnecessarily qualified inner class access"
+ },
+ "fullDescription": {
+ "text": "Reports any references to inner classes that are unnecessarily qualified with the name of the enclosing class. Such a qualification can be safely removed, which sometimes adds an import for the inner class. Example: 'class X {\n X.Y foo;\n class Y{}\n }' After the quick-fix is applied: 'class X {\n Y foo;\n class Y{}\n }' Use the Ignore references for which an import is needed option to ignore references to inner classes, where removing the qualification adds an import. Inspection ID: UnnecessarilyQualifiedInnerClassAccess",
+ "markdown": "Reports any references to inner classes that are unnecessarily qualified with the name of the enclosing class.\n\nSuch a qualification can be safely removed, which sometimes adds an import for the inner class.\n\nExample:\n\n\n class X {\n X.Y foo;\n class Y{}\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n Y foo;\n class Y{}\n }\n\nUse the **Ignore references for which an import is needed** option to ignore references to inner classes, where\nremoving the qualification adds an import.\n\n\nInspection ID: UnnecessarilyQualifiedInnerClassAccess"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnnecessarilyQualifiedInnerClassAccess",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavadocLinkAsPlainText",
+ "shortDescription": {
+ "text": "Link specified as plain text"
+ },
+ "fullDescription": {
+ "text": "Reports plain text links in Javadoc comments. The quick-fix suggests to wrap the link in an '' tag. Example: 'class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }' After the quick-fix is applied: 'class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }' Inspection ID: JavadocLinkAsPlainText New in 2022.1",
+ "markdown": "Reports plain text links in Javadoc comments.\n\n\nThe quick-fix suggests to wrap the link in an `` tag.\n\n**Example:**\n\n\n class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }\n\nInspection ID: JavadocLinkAsPlainText\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocLinkAsPlainText",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SharedThreadLocalRandom",
+ "shortDescription": {
+ "text": "'ThreadLocalRandom' instance might be shared"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.concurrent.ThreadLocalRandom' instances which might be shared between threads. A 'ThreadLocalRandom' should not be shared between threads because that is not thread-safe. The inspection reports instances that are assigned to a field used as a method argument, or assigned to a local variable and used in anonymous or nested classes as they might get shared between threads. Usages of 'ThreadLocalRandom' should typically look like 'ThreadLocalRandom.current().nextInt(...)' (or 'nextDouble(...)' etc.). When all usages are in this form, 'ThreadLocalRandom' instances cannot be used accidentally by multiple threads. Example: 'class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }' Use the options to list methods that are safe to be passed to 'ThreadLocalRandom' instances as an argument. It's possible to use regular expressions for method names. Inspection ID: SharedThreadLocalRandom",
+ "markdown": "Reports `java.util.concurrent.ThreadLocalRandom` instances which might be shared between threads.\n\n\nA `ThreadLocalRandom` should not be shared between threads because that is not thread-safe.\nThe inspection reports instances that are assigned to a field used as a method argument,\nor assigned to a local variable and used in anonymous or nested classes as they might get shared between threads.\n\n\nUsages of `ThreadLocalRandom` should typically look like `ThreadLocalRandom.current().nextInt(...)`\n(or `nextDouble(...)` etc.).\nWhen all usages are in this form, `ThreadLocalRandom` instances cannot be used accidentally by multiple threads.\n\n**Example:**\n\n\n class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }\n \n\nUse the options to list methods that are safe to be passed to `ThreadLocalRandom` instances as an argument.\nIt's possible to use regular expressions for method names.\n\nInspection ID: SharedThreadLocalRandom"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SharedThreadLocalRandom",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WhileCanBeDoWhile",
+ "shortDescription": {
+ "text": "'while' can be replaced with 'do while'"
+ },
+ "fullDescription": {
+ "text": "Reports 'while' loops that could be more effectively written as 'do-while' loops. There are 'while' loops where the code just before the loop is identical to the code in the body of the loop. Replacing with a 'do-while' loop removes the duplicated code. For 'while' loops without such duplicated code, the quick fix is offered in the editor as well, but without highlighting. Example: 'foo();\n while (x) {\n foo();\n }' Can be replaced with: 'do {\n foo();\n } while (x);' New in 2024.1 Inspection ID: WhileCanBeDoWhile",
+ "markdown": "Reports `while` loops that could be more effectively written as `do-while` loops.\nThere are `while` loops where the code just before the loop is identical to the code in the body of the loop.\nReplacing with a `do-while` loop removes the duplicated code.\nFor `while` loops without such duplicated code, the quick fix is offered in the editor as well, but without highlighting.\n\n**Example:**\n\n\n foo();\n while (x) {\n foo();\n }\n\nCan be replaced with:\n\n\n do {\n foo();\n } while (x);\n\n\nNew in 2024.1\n\nInspection ID: WhileCanBeDoWhile"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "WhileCanBeDoWhile",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractMethodOverridesConcreteMethod",
+ "shortDescription": {
+ "text": "Abstract method overrides concrete method"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' methods that override concrete super methods. Methods overridden from 'java.lang.Object' are not reported by this inspection. Inspection ID: AbstractMethodOverridesConcreteMethod",
+ "markdown": "Reports `abstract` methods that override concrete super methods.\n\nMethods overridden from `java.lang.Object` are not reported by this inspection.\n\nInspection ID: AbstractMethodOverridesConcreteMethod"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractMethodOverridesConcreteMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 158,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CodeBlock2Expr",
+ "shortDescription": {
+ "text": "Statement lambda can be replaced with expression lambda"
+ },
+ "fullDescription": {
+ "text": "Reports lambda expressions with code block bodies when expression-style bodies can be used instead. The result of the conversion is shorter and more clear. Example: 'Comparable c = o -> {return 0;};' After the quick-fix is applied: 'Comparable c = o -> 0;' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: CodeBlock2Expr",
+ "markdown": "Reports lambda expressions with code block bodies when expression-style bodies can be used instead. The result of the conversion is shorter and more clear.\n\nExample:\n\n\n Comparable c = o -> {return 0;};\n\nAfter the quick-fix is applied:\n\n\n Comparable c = o -> 0;\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: CodeBlock2Expr"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CodeBlock2Expr",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifyForEach",
+ "shortDescription": {
+ "text": "Simplifiable forEach() call"
+ },
+ "fullDescription": {
+ "text": "Reports 'forEach()' calls that can be replaced with a more concise method or from which intermediate steps can be extracted. Example: 'List findNStrings(List list, int n) {\n List other = new ArrayList<>();\n list.forEach(s -> {\n if(s.length() > n) other.add(s);\n });\n return other;\n }' After the quick-fix is applied: 'List findNStrings(List list, int n) {\n List other = list.stream()\n .filter(s -> s.length() > n)\n .collect(Collectors.toList());\n return other;\n }' This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: SimplifyForEach New in 2017.3",
+ "markdown": "Reports `forEach()` calls that can be replaced with a more concise method or from which intermediate steps can be extracted.\n\n**Example:**\n\n\n List findNStrings(List list, int n) {\n List other = new ArrayList<>();\n list.forEach(s -> {\n if(s.length() > n) other.add(s);\n });\n return other;\n }\n\nAfter the quick-fix is applied:\n\n\n List findNStrings(List list, int n) {\n List other = list.stream()\n .filter(s -> s.length() > n)\n .collect(Collectors.toList());\n return other;\n }\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: SimplifyForEach\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SimplifyForEach",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 124,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantFieldInitialization",
+ "shortDescription": {
+ "text": "Redundant field initialization"
+ },
+ "fullDescription": {
+ "text": "Reports fields explicitly initialized to their default values. Example: 'class Foo {\n int foo = 0;\n List bar = null;\n }' After the quick-fix is applied: 'class Foo {\n int foo;\n List bar;\n }' Use the inspection settings to only report explicit 'null' initialization, for example: 'class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }' Inspection ID: RedundantFieldInitialization",
+ "markdown": "Reports fields explicitly initialized to their default values.\n\n**Example:**\n\n\n class Foo {\n int foo = 0;\n List bar = null;\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo;\n List bar;\n }\n\n\nUse the inspection settings to only report explicit `null` initialization, for example:\n\n\n class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }\n\nInspection ID: RedundantFieldInitialization"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantFieldInitialization",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Since15",
+ "shortDescription": {
+ "text": "Usages of API which isn't available at the configured language level"
+ },
+ "fullDescription": {
+ "text": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things: Highlight usage of generified classes when the language level is below Java 7. Highlight when default methods are not overridden and the language level is below Java 8. Highlight usage of API when the language level is lower than marked using the '@since' tag in the documentation. Use the Forbid API usages option to forbid usages of the API in respect to the project or custom language level. Inspection ID: Since15",
+ "markdown": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things:\n\n* Highlight usage of generified classes when the language level is below Java 7.\n* Highlight when default methods are not overridden and the language level is below Java 8.\n* Highlight usage of API when the language level is lower than marked using the `@since` tag in the documentation.\n\n\nUse the **Forbid API usages** option to forbid usages of the API in respect to the project or custom language level.\n\nInspection ID: Since15"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "Since15",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical",
+ "codeQualityCategory": "Sanity"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 1,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadObjectInitialization",
+ "shortDescription": {
+ "text": "Instance field may not be initialized by 'readObject()'"
+ },
+ "fullDescription": {
+ "text": "Reports fields that are not guaranteed to be initialized after the object is deserialized by the 'readObject()' method. The inspection doesn't report transient fields. Note: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields as uninitialized. Example: 'class DataObject implements Serializable {\n String s; // s is not initialized in readObject\n int i;\n\n private void readObject(ObjectInputStream stream) throws IOException {\n i = stream.readInt();\n }\n}' Inspection ID: ReadObjectInitialization",
+ "markdown": "Reports fields that are not guaranteed to be initialized after the object is deserialized by the `readObject()` method.\n\nThe inspection doesn't report transient fields.\n\n\nNote: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields\nas uninitialized.\n\n**Example:**\n\n\n class DataObject implements Serializable {\n String s; // s is not initialized in readObject\n int i;\n\n private void readObject(ObjectInputStream stream) throws IOException {\n i = stream.readInt();\n }\n }\n\nInspection ID: ReadObjectInitialization"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceVariableMayNotBeInitializedByReadObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 20,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonAtomicOperationOnVolatileField",
+ "shortDescription": {
+ "text": "Non-atomic operation on 'volatile' field"
+ },
+ "fullDescription": {
+ "text": "Reports non-atomic operations on volatile fields. An example of a non-atomic operation is updating the field using the increment operator. As the operation involves read and write, and other modifications may happen in between, data may become corrupted. The operation can be made atomic by surrounding it with a 'synchronized' block or using one of the classes from the 'java.util.concurrent.atomic' package. Example: 'private volatile int v = 1;\n\n void foo() {\n v = 2 * v;\n }' Inspection ID: NonAtomicOperationOnVolatileField",
+ "markdown": "Reports non-atomic operations on volatile fields.\n\n\nAn example of a non-atomic operation is updating the field using the increment operator.\nAs the operation involves read and write, and other modifications may happen in between, data may become corrupted.\nThe operation can be made atomic by surrounding it with a `synchronized` block or\nusing one of the classes from the `java.util.concurrent.atomic` package.\n\n**Example:**\n\n\n private volatile int v = 1;\n\n void foo() {\n v = 2 * v;\n }\n\nInspection ID: NonAtomicOperationOnVolatileField"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonAtomicOperationOnVolatileField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "QuestionableName",
+ "shortDescription": {
+ "text": "Questionable name"
+ },
+ "fullDescription": {
+ "text": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards. Example: 'int aa = 42;' Rename quick-fix is suggested only in the editor. Use the option to list names that should be reported. Inspection ID: QuestionableName",
+ "markdown": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards.\n\n**Example:**\n\n\n int aa = 42;\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to list names that should be reported.\n\n\nInspection ID: QuestionableName"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "QuestionableName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 76,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantLengthCheck",
+ "shortDescription": {
+ "text": "Redundant array length check"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly. Example: 'void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }' A quick-fix is suggested to unwrap or remove the length check: 'void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }' Inspection ID: RedundantLengthCheck New in 2022.3",
+ "markdown": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly.\n\nExample:\n\n\n void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }\n\nA quick-fix is suggested to unwrap or remove the length check:\n\n\n void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }\n\nInspection ID: RedundantLengthCheck\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantLengthCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 48,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UNCHECKED_WARNING",
+ "shortDescription": {
+ "text": "Unchecked warning"
+ },
+ "fullDescription": {
+ "text": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger 'ClassCastException' at runtime. Example: 'List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment' Inspection ID: UNCHECKED_WARNING",
+ "markdown": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger `ClassCastException` at runtime.\n\nExample:\n\n\n List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment\n\nInspection ID: UNCHECKED_WARNING"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "unchecked",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Compiler issues",
+ "index": 171,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DataFlowIssue",
+ "shortDescription": {
+ "text": "Nullability and data flow problems"
+ },
+ "fullDescription": {
+ "text": "Reports code constructs that always violate nullability contracts, may throw exceptions, or are just redundant, based on data flow analysis. Examples: 'if (array.length < index) {\n System.out.println(array[index]);\n} // Array index is always out of bounds\n\nif (str == null) System.out.println(\"str is null\");\nSystem.out.println(str.trim());\n// the last statement may throw an NPE\n\n@NotNull\nInteger square(@Nullable Integer input) {\n // the method contract is violated\n return input == null ? null : input * input;\n}' The inspection behavior may be controlled by a number of annotations, such as nullability annotations, '@Contract' annotation, '@Range' annotation and so on. Configure the inspection: Use the Suggest @Nullable annotation for methods/fields/parameters where nullable values are used option to warn when a nullable value is passed as an argument to a method with a non-annotated parameter, stored into non-annotated field, or returned from a non-annotated method. In this case, the inspection will suggest propagating the '@Nullable' annotation. You can also configure nullability annotations using the Configure Annotations button. Use the Treat non-annotated members and parameters as @Nullable option to assume that non-annotated members can be null, so they must not be used in non-null context. Use the Report not-null required parameter with null-literal argument usages option to report method parameters that cannot be null (e.g. immediately dereferenced in the method body), but there are call sites where a 'null' literal is passed. Use the Report nullable methods that always return a non-null value option to report methods that are annotated as '@Nullable', but always return non-null value. In this case, it's suggested that you change the annotation to '@NotNull'. Use the Ignore assert statements option to control how the inspection treats 'assert' statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode). Use the Report problems that happen only on some code paths option to control whether to report problems that may happen only on some code path. If this option is disabled, warnings like exception is possible will not be reported. The inspection will report only warnings like exception will definitely occur. This mode may greatly reduce the number of false-positives, especially if the code is not consistently annotated with nullability and contract annotations. That is why it can be useful for finding the most important problems in legacy code bases. Before IntelliJ IDEA 2022.3, this inspection was part of the \"Constant Conditions & Exceptions\" inspection. Now, it is split into two inspections: \"Constant Values\" and \"Nullability and data flow problems\". Inspection ID: DataFlowIssue",
+ "markdown": "Reports code constructs that always violate nullability contracts, may throw exceptions, or are just redundant, based on data flow analysis.\n\nExamples:\n\n if (array.length < index) {\n System.out.println(array[index]);\n } // Array index is always out of bounds\n\n if (str == null) System.out.println(\"str is null\");\n System.out.println(str.trim());\n // the last statement may throw an NPE\n\n @NotNull\n Integer square(@Nullable Integer input) {\n // the method contract is violated\n return input == null ? null : input * input;\n }\n\n\nThe inspection behavior may be controlled by a number of annotations, such as\n[nullability](https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html) annotations,\n[@Contract](https://www.jetbrains.com/help/idea/contract-annotations.html) annotation,\n`@Range` annotation and so on.\n\nConfigure the inspection:\n\n* Use the **Suggest @Nullable annotation for methods/fields/parameters where nullable values are used** option to warn when a nullable value is passed as an argument to a method with a non-annotated parameter, stored into non-annotated field, or returned from a non-annotated method. In this case, the inspection will suggest propagating the `@Nullable` annotation. You can also configure nullability annotations using the **Configure Annotations** button.\n* Use the **Treat non-annotated members and parameters as @Nullable** option to assume that non-annotated members can be null, so they must not be used in non-null context.\n* Use the **Report not-null required parameter with null-literal argument usages** option to report method parameters that cannot be null (e.g. immediately dereferenced in the method body), but there are call sites where a `null` literal is passed.\n* Use the **Report nullable methods that always return a non-null value** option to report methods that are annotated as `@Nullable`, but always return non-null value. In this case, it's suggested that you change the annotation to `@NotNull`.\n* Use the **Ignore assert statements** option to control how the inspection treats `assert` statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode).\n* Use the **Report problems that happen only on some code paths** option to control whether to report problems that may happen only on some code path. If this option is disabled, warnings like *exception is possible* will not be reported. The inspection will report only warnings like *exception will definitely occur*. This mode may greatly reduce the number of false-positives, especially if the code is not consistently annotated with nullability and contract annotations. That is why it can be useful for finding the most important problems in legacy code bases.\n\n\nBefore IntelliJ IDEA 2022.3, this inspection was part of the \"Constant Conditions \\& Exceptions\" inspection.\nNow, it is split into two inspections:\n\"Constant Values\" and \"Nullability and data flow problems\".\n\nInspection ID: DataFlowIssue"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DataFlowIssue",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 16,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterCanBeLocal",
+ "shortDescription": {
+ "text": "Value passed as parameter never read"
+ },
+ "fullDescription": {
+ "text": "Reports redundant method parameters that can be replaced with local variables. If all local usages of a parameter are preceded by assignments to that parameter, the parameter can be removed and its usages replaced with local variables. It makes no sense to have such a parameter, as values that are passed to it are overwritten. Usually, the problem appears as a result of refactoring. Example: 'void test(int p) {\n p = 1;\n System.out.print(p);\n }' After the quick-fix is applied: 'void test() {\n int p = 1;\n System.out.print(p);\n }' Inspection ID: ParameterCanBeLocal",
+ "markdown": "Reports redundant method parameters that can be replaced with local variables.\n\nIf all local usages of a parameter are preceded by assignments to that parameter, the\nparameter can be removed and its usages replaced with local variables.\nIt makes no sense to have such a parameter, as values that are passed to it are overwritten.\nUsually, the problem appears as a result of refactoring.\n\nExample:\n\n\n void test(int p) {\n p = 1;\n System.out.print(p);\n }\n\nAfter the quick-fix is applied:\n\n\n void test() {\n int p = 1;\n System.out.print(p);\n }\n\nInspection ID: ParameterCanBeLocal"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterCanBeLocal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 21,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchStatementDensity",
+ "shortDescription": {
+ "text": "'switch' statement with too low of a branch density"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements or expressions with a too low ratio of switch labels to executable statements. Such 'switch' statements may be confusing and should probably be refactored. Example: 'switch (i) { // one case and 5 executable statements -> 20% density\n case 1:\n System.out.println(\"1\");\n System.out.println(\"2\");\n System.out.println(\"3\");\n System.out.println(\"4\");\n System.out.println(\"5\");\n break;\n }' Use the Minimum density of branches field to specify the allowed ratio of the switch labels to executable statements. Inspection ID: SwitchStatementDensity",
+ "markdown": "Reports `switch` statements or expressions with a too low ratio of switch labels to executable statements.\n\nSuch `switch` statements\nmay be confusing and should probably be refactored.\n\nExample:\n\n\n switch (i) { // one case and 5 executable statements -> 20% density\n case 1:\n System.out.println(\"1\");\n System.out.println(\"2\");\n System.out.println(\"3\");\n System.out.println(\"4\");\n System.out.println(\"5\");\n break;\n }\n\n\nUse the **Minimum density of branches** field to specify the allowed ratio of the switch labels to executable statements.\n\nInspection ID: SwitchStatementDensity"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SwitchStatementDensity",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MismatchedJavadocCode",
+ "shortDescription": {
+ "text": "Mismatch between Javadoc and code"
+ },
+ "fullDescription": {
+ "text": "Reports parts of method specification written in English that contradict with the method declaration. This includes: Method specified to return 'true' or 'false' but its return type is not boolean. Method specified to return 'null' but it's annotated as '@NotNull' or its return type is primitive. Method specified to return list but its return type is set or array. And so on. Example: '/**\n * @return true if user is found, false otherwise\n */\n User findUser(String name);' Note that false-positives are possible, as this inspection tries to interpret a human language. However, if the inspection reports incorrectly, it's still possible that the description is confusing and should be rewritten. New in 2022.3 Inspection ID: MismatchedJavadocCode",
+ "markdown": "Reports parts of method specification written in English that contradict with the method declaration. This includes:\n\n* Method specified to return `true` or `false` but its return type is not boolean.\n* Method specified to return `null` but it's annotated as `@NotNull` or its return type is primitive.\n* Method specified to return list but its return type is set or array.\n* And so on.\n\n**Example:**\n\n\n /**\n * @return true if user is found, false otherwise\n */\n User findUser(String name);\n\n\nNote that false-positives are possible, as this inspection tries to interpret a human language. However, if the inspection reports\nincorrectly, it's still possible that the description is confusing and should be rewritten.\n\n\nNew in 2022.3\n\nInspection ID: MismatchedJavadocCode"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MismatchedJavadocCode",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 74,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableAnnotation",
+ "shortDescription": {
+ "text": "Simplifiable annotation"
+ },
+ "fullDescription": {
+ "text": "Reports annotations that can be simplified to their single-element or marker shorthand form. Problems reported: Redundant 'value=' in annotation name-value pairs Redundant braces around array values that contain only a single value Redundant whitespace between the @-sign and the name of annotations Redundant whitespace between annotation names and parameter lists Redundant parentheses in annotations without any parameters Example: '@interface Foo { String[] value(); }\n\n @ Foo({\"foo\"})\n public String name;' After the quick-fix is applied: '@interface Foo { String[] value(); }\n\n @Foo(\"foo\")\n public String name;' Inspection ID: SimplifiableAnnotation",
+ "markdown": "Reports annotations that can be simplified to their single-element or marker shorthand form.\n\n\nProblems reported:\n\n* Redundant `value=` in annotation name-value pairs\n* Redundant braces around array values that contain only a single value\n* Redundant whitespace between the @-sign and the name of annotations\n* Redundant whitespace between annotation names and parameter lists\n* Redundant parentheses in annotations without any parameters\n\n**Example:**\n\n\n @interface Foo { String[] value(); }\n\n @ Foo({\"foo\"})\n public String name;\n\nAfter the quick-fix is applied:\n\n\n @interface Foo { String[] value(); }\n\n @Foo(\"foo\")\n public String name;\n\nInspection ID: SimplifiableAnnotation"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High",
+ "codeQualityCategory": "Unspecified"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IU"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Guava",
+ "shortDescription": {
+ "text": "Guava's functional primitives can be replaced with Java"
+ },
+ "fullDescription": {
+ "text": "Reports usages of Guava's functional primitives that can be migrated to standard Java API calls. For example, the inspection reports usages of classes and interfaces like 'FluentIterable', 'Optional', 'Function', 'Predicate', or 'Supplier'. Example: 'ImmutableList results = FluentIterable.from(List.of(1, 2, 3)).transform(Object::toString).toList();' After the quick-fix is applied: 'List results = List.of(1, 2, 3).stream().map(Object::toString).collect(Collectors.toList());' The quick-fix may change the semantics. Some lazily evaluated Guava iterables can be transformed to eagerly evaluated. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: Guava",
+ "markdown": "Reports usages of Guava's functional primitives that can be migrated to standard Java API calls.\n\nFor example, the inspection reports usages of classes and interfaces like `FluentIterable`, `Optional`, `Function`,\n`Predicate`, or `Supplier`.\n\nExample:\n\n\n ImmutableList