All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codemodder.codemods.DefaultCodemods Maven / Gradle / Ivy

There is a newer version: 0.97.3
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy