io.codemodder.codemods.DefaultCodemods Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-codemods Show documentation
Show all versions of core-codemods Show documentation
Codemods for fixing common errors across many Java projects
package io.codemodder.codemods;
import io.codemodder.CodeChanger;
import io.codemodder.Runner;
import io.codemodder.codemods.semgrep.SemgrepJavaDeserializationCodemod;
import io.codemodder.codemods.semgrep.SemgrepMissingSecureFlagCodemod;
import io.codemodder.codemods.semgrep.SemgrepReflectionInjectionCodemod;
import io.codemodder.codemods.semgrep.SemgrepSQLInjectionCodemod;
import io.codemodder.codemods.semgrep.SemgrepSQLInjectionFormattedSqlStringCodemod;
import io.codemodder.codemods.semgrep.SemgrepSSRFCodemod;
import io.codemodder.codemods.semgrep.SemgrepServletResponseWriterXSSCodemod;
import io.codemodder.codemods.semgrep.SemgrepWeakRandomCodemod;
import io.codemodder.codemods.semgrep.SemgrepXXECodemod;
import java.util.List;
/**
* Give an ability for users to list all the codemods so they don't have to reference them
* individually.
*/
public final class DefaultCodemods {
/** Get a list of all the codemods in our default set. */
public static List> asList() {
return List.of(
AddClarifyingBracesCodemod.class,
AddMissingOverrideCodemod.class,
AvoidImplicitPublicConstructorCodemod.class,
DeclareVariableOnSeparateLineCodemod.class,
DefectDojoSqlInjectionCodemod.class,
DefineConstantForLiteralCodemod.class,
DisableAutomaticDirContextDeserializationCodemod.class,
FixRedundantStaticOnEnumCodemod.class,
HardenJavaDeserializationCodemod.class,
HardenStringParseToPrimitivesCodemod.class,
HardenProcessCreationCodemod.class,
HardenXMLDecoderCodemod.class,
HardenXMLInputFactoryCodemod.class,
HardenXMLReaderCodemod.class,
HardenXStreamCodemod.class,
HardenZipEntryPathsCodemod.class,
HQLParameterizationCodemod.class,
InputResourceLeakCodemod.class,
InsecureCookieCodemod.class,
JDBCResourceLeakCodemod.class,
JEXLInjectionCodemod.class,
JSPScriptletXSSCodemod.class,
LimitReadlineCodemod.class,
MavenSecureURLCodemod.class,
OutputResourceLeakCodemod.class,
OverridesMatchParentSynchronizationCodemod.class,
PreventFileWriterLeakWithFilesCodemod.class,
RandomizeSeedCodemod.class,
RemoveRedundantVariableCreationCodemod.class,
RemoveUnusedImportCodemod.class,
RemoveUnusedLocalVariableCodemod.class,
RemoveUnusedPrivateMethodCodemod.class,
RemoveUselessParenthesesCodemod.class,
ReplaceDefaultHttpClientCodemod.class,
ReplaceStreamCollectorsToListCodemod.class,
// ResourceLeakCodemod.class,
SanitizeApacheMultipartFilenameCodemod.class,
SanitizeHttpHeaderCodemod.class,
SanitizeSpringMultipartFilenameCodemod.class,
SecureRandomCodemod.class,
SemgrepJavaDeserializationCodemod.class,
SemgrepMissingSecureFlagCodemod.class,
SemgrepReflectionInjectionCodemod.class,
SemgrepServletResponseWriterXSSCodemod.class,
SemgrepSSRFCodemod.class,
SemgrepSQLInjectionCodemod.class,
SemgrepSQLInjectionFormattedSqlStringCodemod.class,
SemgrepWeakRandomCodemod.class,
SemgrepXXECodemod.class,
SemgrepOverlyPermissiveFilePermissionsCodemod.class,
SimplifyRestControllerAnnotationsCodemod.class,
SubstituteReplaceAllCodemod.class,
SonarRemoveUnthrowableExceptionCodemod.class,
SonarXXECodemod.class,
SonarSQLInjectionCodemod.class,
SonarUnsafeReflectionRemediationCodemod.class,
SQLParameterizerCodemod.class,
SSRFCodemod.class,
StackTraceExposureCodemod.class,
SwitchLiteralFirstComparisonsCodemod.class,
SwitchToStandardCharsetsCodemod.class,
UnverifiedJwtCodemod.class,
UpgradeSSLContextTLSCodemod.class,
UpgradeSSLEngineTLSCodemod.class,
UpgradeSSLParametersTLSCodemod.class,
UpgradeSSLSocketProtocolsTLSCodemod.class,
UpgradeTempFileToNIOCodemod.class,
UseEmptyForToArrayCodemod.class,
ValidateJakartaForwardPathCodemod.class,
VerboseRequestMappingCodemod.class,
VerbTamperingCodemod.class);
}
/**
* Entry point for core codemods.
*
* @param args the arguments to pass to the runner
*/
public static void main(final String[] args) {
Runner.run(asList(), args);
}
}