-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
12,065 additions
and
11,804 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,125 @@ | ||
{"version":"3","listProblem":[{ | ||
"tool": "Code Inspection", | ||
"category": "Verbose or redundant code constructs", | ||
"type": "Unnecessary 'continue' statement", | ||
"type": "Lombok @Setter may be used", | ||
"tags": [ | ||
"JAVA" | ||
], | ||
"severity": "High", | ||
"comment": "`continue` is unnecessary as the last statement in a loop", | ||
"detailsInfo": "Reports `continue` statements if they are the last reachable statements in the loop. These `continue` statements are unnecessary and can be safely removed.\n\nExample:\n\n\n for (String element: elements) {\n System.out.println();\n continue;\n }\n\nAfter the quick-fix is applied:\n\n\n for (String element: elements) {\n System.out.println();\n }\n\nThe inspection doesn't analyze JSP files.\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore\n`continue` statements when they are placed in a `then` branch of a complete\n`if`-`else` statement.\n\nExample:\n\n\n for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }\n", | ||
"comment": "Class 'AbstractFindMethodDiagnostic' may use Lombok @Setter", | ||
"detailsInfo": "Reports standard setter method that can be replaced by the lombok `@Setter` annotation.\n\nExample:\n\n\n import java.util.Date;\n\n public class MyClass {\n /**\n * The process date.\n */\n private Date processDate;\n\n /**\n * Sets the date.\n *\n * @param The date\n */\n public void setProcessDate(Date param) {\n processDate = param;\n }\n }\n\nAfter the quick-fix/cleanup is applied:\n\n\n import lombok.Setter;\n import java.util.Date;\n\n @Setter\n public class MyClass {\n /**\n * The process date.\n * -- SETTER --\n * Sets the date.\n *\n * @param The date\n */\n private Date processDate;\n }\n\nIt only reports when the lombok library is configured. To unlombok, see the lombok site.\n\nNew in 2023.2", | ||
"sources": [ | ||
{ | ||
"type": "file", | ||
"path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/expressiontree/ExpressionTreeBuildingVisitor.java", | ||
"path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/AbstractFindMethodDiagnostic.java", | ||
"language": "JAVA", | ||
"line": 99, | ||
"offset": 11, | ||
"length": 8, | ||
"line": 41, | ||
"offset": 23, | ||
"length": 28, | ||
"code": { | ||
"startLine": 97, | ||
"length": 8, | ||
"offset": 144, | ||
"surroundingCode": " visitMember((BSLParser.MemberContext) child);\n } else if (child.getClass() == BSLParser.PreprocessorContext.class) {\n continue;\n } else {\n throw new IllegalStateException();" | ||
"startLine": 39, | ||
"length": 28, | ||
"offset": 106, | ||
"surroundingCode": " * параметром сообщения пользователю <b>всегда</b> будет имя найденного метода.\n */\npublic abstract class AbstractFindMethodDiagnostic extends AbstractVisitorDiagnostic {\n\n @Getter" | ||
} | ||
} | ||
], | ||
"attributes": { | ||
"module": "bsl-language-server.main", | ||
"inspectionName": "UnnecessaryContinue" | ||
"inspectionName": "LombokSetterMayBeUsed" | ||
}, | ||
"hash": "8cc81c86fb327f144191359d8026afa00236f66f632e452051aa19d63a0540d0" | ||
"hash": "e718c5d6de5b9d1cfe49cffb1b0469639c2630a78ef612ce6efa9f4b892a513f" | ||
},{ | ||
"tool": "Code Inspection", | ||
"category": "Declaration redundancy", | ||
"type": "'protected' member in 'final' class", | ||
"tags": [ | ||
"JAVA" | ||
], | ||
"severity": "High", | ||
"comment": "Class member declared `protected` in 'final' class", | ||
"detailsInfo": "Reports `protected` members in `final`classes.\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.", | ||
"sources": [ | ||
{ | ||
"type": "file", | ||
"path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/expressiontree/TernaryOperatorNode.java", | ||
"language": "JAVA", | ||
"line": 40, | ||
"offset": 3, | ||
"length": 9, | ||
"code": { | ||
"startLine": 38, | ||
"length": 9, | ||
"offset": 30, | ||
"surroundingCode": " BslExpression falsePart;\n\n protected TernaryOperatorNode(BslExpression condition, BslExpression truePart, BslExpression falsePart) {\n super(ExpressionNodeType.TERNARY_OP);\n this.condition = condition;" | ||
} | ||
} | ||
], | ||
"attributes": { | ||
"module": "bsl-language-server.main", | ||
"inspectionName": "ProtectedMemberInFinalClass" | ||
}, | ||
"hash": "d9c993d92b4291aaeef7c252b06070217bdf419d186aff75c238630e051b7199" | ||
},{ | ||
"tool": "Code Inspection", | ||
"category": "RegExp", | ||
"type": "Regular expression can be simplified", | ||
"tags": [ | ||
"RegExp" | ||
], | ||
"severity": "Moderate", | ||
"comment": "`[\\\\*]` can be simplified to '\\\\\\*'", | ||
"detailsInfo": "Reports regular expressions that can be simplified.\n\n**Example:**\n\n\n [a] xx* [ah-hz]\n\nAfter the quick-fix is applied:\n\n\n a x+ [ahz]\n\nNew in 2022.1", | ||
"sources": [ | ||
{ | ||
"type": "file", | ||
"path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsingHardcodeSecretInformationDiagnostic.java", | ||
"language": "JAVA", | ||
"line": 67, | ||
"offset": 75, | ||
"length": 5, | ||
"code": { | ||
"startLine": 65, | ||
"length": 5, | ||
"offset": 80, | ||
"surroundingCode": " );\n\n private static final Pattern PATTERN_CHECK_PASSWORD = Pattern.compile(\"^[\\\\*]+$\", Pattern.UNICODE_CASE);\n\n @DiagnosticParameter(" | ||
} | ||
} | ||
], | ||
"attributes": { | ||
"module": "bsl-language-server.main", | ||
"inspectionName": "RegExpSimplifiable" | ||
}, | ||
"hash": "a96a0536e198cbff96eebc4edc9806807b12725ac46694da2501ad5bce236c55" | ||
},{ | ||
"tool": "Code Inspection", | ||
"category": "Verbose or redundant code constructs", | ||
"type": "Unnecessary 'default' for enum 'switch' statement", | ||
"tags": [ | ||
"JAVA" | ||
], | ||
"severity": "High", | ||
"comment": "`default` branch is unnecessary", | ||
"detailsInfo": "Reports enum `switch` statements or expression with `default` branches which can never be taken, because all possible values are covered by a `case` branch.\n\nSuch elements are redundant, especially for `switch` expressions, because they don't compile when all\nenum constants are not covered by a `case` branch.\n\n\nThe language level needs to be configured to 14 to report `switch` expressions.\n\nThe provided quick-fix removes `default` branches.\n\nExample:\n\n\n enum E { A, B }\n int foo(E e) {\n return switch (e) {\n case A -> 1;\n case B -> 2;\n default -> 3;\n };\n }\n\nAfter the quick-fix is applied:\n\n\n enum E { A, B }\n int foo(E e) {\n return switch (e) {\n case A -> 1;\n case B -> 2;\n };\n }\n\nUse the **Only report switch expressions** option to report only redundant `default` branches in switch expressions.", | ||
"sources": [ | ||
{ | ||
"type": "file", | ||
"path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/expressiontree/DefaultNodeEqualityComparer.java", | ||
"language": "JAVA", | ||
"line": 51, | ||
"offset": 7, | ||
"length": 7, | ||
"code": { | ||
"startLine": 49, | ||
"length": 7, | ||
"offset": 136, | ||
"surroundingCode": " case SKIPPED_CALL_ARG -> true;\n case CALL -> callStatementsEqual((AbstractCallNode) first, (AbstractCallNode) second);\n default -> throw new IllegalStateException();\n };\n" | ||
} | ||
} | ||
], | ||
"attributes": { | ||
"module": "bsl-language-server.main", | ||
"inspectionName": "UnnecessaryDefault" | ||
}, | ||
"hash": "2c72370b59dde2cbf1ea29e8feac3da6f729b7114f1766f8f09a515ec88ac90f" | ||
}]} |
Oops, something went wrong.