@Test public void all_checks_should_be_present() { File directory = new File("src/main/java/org/sonarsource/slang/checks"); File[] checkFiles = directory.listFiles((dir, name) -> name.endsWith("Check.java") && !name.startsWith("Abstract")); assertThat(CheckList.allChecks().size() + ALL_CHECKS_WITH_LANGUAGE_CONFIG.length).isEqualTo(checkFiles.length); }
static List<Class> allChecks() { return Arrays.asList( AllBranchesIdenticalCheck.class, BadClassNameCheck.class, BadFunctionNameCheck.class, BooleanInversionCheck.class, BooleanLiteralCheck.class, CodeAfterJumpCheck.class, CollapsibleIfStatementsCheck.class, DuplicateBranchCheck.class, DuplicatedFunctionImplementationCheck.class, ElseIfWithoutElseCheck.class, EmptyBlockCheck.class, EmptyCommentCheck.class, EmptyFunctionCheck.class, FileHeaderCheck.class, FixMeCommentCheck.class, FunctionCognitiveComplexityCheck.class, HardcodedCredentialsCheck.class, HardcodedIpCheck.class, IdenticalBinaryOperandCheck.class, IdenticalConditionsCheck.class, IfConditionalAlwaysTrueOrFalseCheck.class, MatchCaseTooBigCheck.class, MatchWithoutElseCheck.class, NestedMatchCheck.class, OctalValuesCheck.class, OneStatementPerLineCheck.class, ParsingErrorCheck.class, RedundantParenthesesCheck.class, SelfAssignmentCheck.class, StringLiteralDuplicatedCheck.class, TabsCheck.class, TodoCommentCheck.class, TooComplexExpressionCheck.class, TooDeeplyNestedStatementsCheck.class, TooLongFunctionCheck.class, TooLongLineCheck.class, TooManyLinesOfCodeFileCheck.class, TooManyCasesCheck.class, TooManyParametersCheck.class, UnusedFunctionParameterCheck.class, UnusedLocalVariableCheck.class, UnusedPrivateMethodCheck.class, VariableAndParameterNameCheck.class, WrongAssignmentOperatorCheck.class); }
CheckList { static List<Class> allChecks() { return Arrays.asList( AllBranchesIdenticalCheck.class, BadClassNameCheck.class, BadFunctionNameCheck.class, BooleanInversionCheck.class, BooleanLiteralCheck.class, CodeAfterJumpCheck.class, CollapsibleIfStatementsCheck.class, DuplicateBranchCheck.class, DuplicatedFunctionImplementationCheck.class, ElseIfWithoutElseCheck.class, EmptyBlockCheck.class, EmptyCommentCheck.class, EmptyFunctionCheck.class, FileHeaderCheck.class, FixMeCommentCheck.class, FunctionCognitiveComplexityCheck.class, HardcodedCredentialsCheck.class, HardcodedIpCheck.class, IdenticalBinaryOperandCheck.class, IdenticalConditionsCheck.class, IfConditionalAlwaysTrueOrFalseCheck.class, MatchCaseTooBigCheck.class, MatchWithoutElseCheck.class, NestedMatchCheck.class, OctalValuesCheck.class, OneStatementPerLineCheck.class, ParsingErrorCheck.class, RedundantParenthesesCheck.class, SelfAssignmentCheck.class, StringLiteralDuplicatedCheck.class, TabsCheck.class, TodoCommentCheck.class, TooComplexExpressionCheck.class, TooDeeplyNestedStatementsCheck.class, TooLongFunctionCheck.class, TooLongLineCheck.class, TooManyLinesOfCodeFileCheck.class, TooManyCasesCheck.class, TooManyParametersCheck.class, UnusedFunctionParameterCheck.class, UnusedLocalVariableCheck.class, UnusedPrivateMethodCheck.class, VariableAndParameterNameCheck.class, WrongAssignmentOperatorCheck.class); } }
CheckList { static List<Class> allChecks() { return Arrays.asList( AllBranchesIdenticalCheck.class, BadClassNameCheck.class, BadFunctionNameCheck.class, BooleanInversionCheck.class, BooleanLiteralCheck.class, CodeAfterJumpCheck.class, CollapsibleIfStatementsCheck.class, DuplicateBranchCheck.class, DuplicatedFunctionImplementationCheck.class, ElseIfWithoutElseCheck.class, EmptyBlockCheck.class, EmptyCommentCheck.class, EmptyFunctionCheck.class, FileHeaderCheck.class, FixMeCommentCheck.class, FunctionCognitiveComplexityCheck.class, HardcodedCredentialsCheck.class, HardcodedIpCheck.class, IdenticalBinaryOperandCheck.class, IdenticalConditionsCheck.class, IfConditionalAlwaysTrueOrFalseCheck.class, MatchCaseTooBigCheck.class, MatchWithoutElseCheck.class, NestedMatchCheck.class, OctalValuesCheck.class, OneStatementPerLineCheck.class, ParsingErrorCheck.class, RedundantParenthesesCheck.class, SelfAssignmentCheck.class, StringLiteralDuplicatedCheck.class, TabsCheck.class, TodoCommentCheck.class, TooComplexExpressionCheck.class, TooDeeplyNestedStatementsCheck.class, TooLongFunctionCheck.class, TooLongLineCheck.class, TooManyLinesOfCodeFileCheck.class, TooManyCasesCheck.class, TooManyParametersCheck.class, UnusedFunctionParameterCheck.class, UnusedLocalVariableCheck.class, UnusedPrivateMethodCheck.class, VariableAndParameterNameCheck.class, WrongAssignmentOperatorCheck.class); } private  CheckList(); }
CheckList { static List<Class> allChecks() { return Arrays.asList( AllBranchesIdenticalCheck.class, BadClassNameCheck.class, BadFunctionNameCheck.class, BooleanInversionCheck.class, BooleanLiteralCheck.class, CodeAfterJumpCheck.class, CollapsibleIfStatementsCheck.class, DuplicateBranchCheck.class, DuplicatedFunctionImplementationCheck.class, ElseIfWithoutElseCheck.class, EmptyBlockCheck.class, EmptyCommentCheck.class, EmptyFunctionCheck.class, FileHeaderCheck.class, FixMeCommentCheck.class, FunctionCognitiveComplexityCheck.class, HardcodedCredentialsCheck.class, HardcodedIpCheck.class, IdenticalBinaryOperandCheck.class, IdenticalConditionsCheck.class, IfConditionalAlwaysTrueOrFalseCheck.class, MatchCaseTooBigCheck.class, MatchWithoutElseCheck.class, NestedMatchCheck.class, OctalValuesCheck.class, OneStatementPerLineCheck.class, ParsingErrorCheck.class, RedundantParenthesesCheck.class, SelfAssignmentCheck.class, StringLiteralDuplicatedCheck.class, TabsCheck.class, TodoCommentCheck.class, TooComplexExpressionCheck.class, TooDeeplyNestedStatementsCheck.class, TooLongFunctionCheck.class, TooLongLineCheck.class, TooManyLinesOfCodeFileCheck.class, TooManyCasesCheck.class, TooManyParametersCheck.class, UnusedFunctionParameterCheck.class, UnusedLocalVariableCheck.class, UnusedPrivateMethodCheck.class, VariableAndParameterNameCheck.class, WrongAssignmentOperatorCheck.class); } private  CheckList(); static List<Class> excludeChecks(Class[] blackList); }
CheckList { static List<Class> allChecks() { return Arrays.asList( AllBranchesIdenticalCheck.class, BadClassNameCheck.class, BadFunctionNameCheck.class, BooleanInversionCheck.class, BooleanLiteralCheck.class, CodeAfterJumpCheck.class, CollapsibleIfStatementsCheck.class, DuplicateBranchCheck.class, DuplicatedFunctionImplementationCheck.class, ElseIfWithoutElseCheck.class, EmptyBlockCheck.class, EmptyCommentCheck.class, EmptyFunctionCheck.class, FileHeaderCheck.class, FixMeCommentCheck.class, FunctionCognitiveComplexityCheck.class, HardcodedCredentialsCheck.class, HardcodedIpCheck.class, IdenticalBinaryOperandCheck.class, IdenticalConditionsCheck.class, IfConditionalAlwaysTrueOrFalseCheck.class, MatchCaseTooBigCheck.class, MatchWithoutElseCheck.class, NestedMatchCheck.class, OctalValuesCheck.class, OneStatementPerLineCheck.class, ParsingErrorCheck.class, RedundantParenthesesCheck.class, SelfAssignmentCheck.class, StringLiteralDuplicatedCheck.class, TabsCheck.class, TodoCommentCheck.class, TooComplexExpressionCheck.class, TooDeeplyNestedStatementsCheck.class, TooLongFunctionCheck.class, TooLongLineCheck.class, TooManyLinesOfCodeFileCheck.class, TooManyCasesCheck.class, TooManyParametersCheck.class, UnusedFunctionParameterCheck.class, UnusedLocalVariableCheck.class, UnusedPrivateMethodCheck.class, VariableAndParameterNameCheck.class, WrongAssignmentOperatorCheck.class); } private  CheckList(); static List<Class> excludeChecks(Class[] blackList);  }