|
|
@ -9,43 +9,39 @@ package com.keyware.sonar.java.rules; |
|
|
|
import com.keyware.sonar.java.rules.checkers.*; |
|
|
|
import com.keyware.sonar.java.rules.checkers.*; |
|
|
|
import org.sonar.plugins.java.api.JavaCheck; |
|
|
|
import org.sonar.plugins.java.api.JavaCheck; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
public final class RulesList { |
|
|
|
public final class RulesList { |
|
|
|
|
|
|
|
|
|
|
|
private RulesList() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<Class<? extends JavaCheck>> getChecks() { |
|
|
|
|
|
|
|
List<Class<? extends JavaCheck>> checks = new ArrayList<>(); |
|
|
|
|
|
|
|
checks.addAll(getJavaChecks()); |
|
|
|
|
|
|
|
checks.addAll(getJavaTestChecks()); |
|
|
|
|
|
|
|
return Collections.unmodifiableList(checks); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* These rules are going to target MAIN code only |
|
|
|
* These rules are going to target MAIN code only |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static List<Class<? extends JavaCheck>> getJavaChecks() { |
|
|
|
public static List<Class<? extends JavaCheck>> getJavaRules() { |
|
|
|
return List.of( |
|
|
|
return List.of( |
|
|
|
ABCVarNameChecker.class, |
|
|
|
//ABCVarNameChecker.class,
|
|
|
|
AbsolutePathDetectorChecker.class, |
|
|
|
AbsolutePathDetectorChecker.class, |
|
|
|
PathAndKeywordCheck.class, |
|
|
|
AvoidSensitiveInfoInLogsCheck.class, |
|
|
|
|
|
|
|
CookieSensitiveParameterCheck.class, |
|
|
|
DynamicCodeChecker.class, |
|
|
|
DynamicCodeChecker.class, |
|
|
|
|
|
|
|
DynamicLibraryLoadChecker.class, |
|
|
|
|
|
|
|
FileCheck.class, |
|
|
|
|
|
|
|
HashSaltPassWordChecker.class, |
|
|
|
|
|
|
|
HttpInputDataChecker.class, |
|
|
|
|
|
|
|
InputSQLVerifyChecker.class, |
|
|
|
|
|
|
|
Md5PassWordVerifyChecker.class, |
|
|
|
|
|
|
|
PasswordRegexCheck.class, |
|
|
|
|
|
|
|
PathAndKeywordCheck.class, |
|
|
|
|
|
|
|
RedirectUrlChecker.class, |
|
|
|
|
|
|
|
RSAEncryptionChecker.class, |
|
|
|
|
|
|
|
SecurityCookieChecker.class, |
|
|
|
SystemFunctionChecker.class, |
|
|
|
SystemFunctionChecker.class, |
|
|
|
UploadFileVerifyChecker.class, |
|
|
|
UploadFileVerifyChecker.class, |
|
|
|
SecurityCookieChecker.class, |
|
|
|
UpperCycleLimitRuleChecker.class |
|
|
|
RedirectUrlChecker.class, |
|
|
|
|
|
|
|
DynamicLibraryLoadChecker.class |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static List<Class<? extends JavaCheck>> getHtmlRules() { |
|
|
|
/** |
|
|
|
return List.of( |
|
|
|
* These rules are going to target TEST code only |
|
|
|
PasswordInputTagChecker.class |
|
|
|
*/ |
|
|
|
); |
|
|
|
public static List<Class<? extends JavaCheck>> getJavaTestChecks() { |
|
|
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|