Standalone Recipes
This doc contains recipes that are not included as part of any larger composite recipe. These recipes can be run independently and are not bundled with other recipes.
Total standalone recipes: 1687
other
- ai.timefold.solver.migration.ToLatest
- Upgrade to the latest Timefold Solver
- Replace all your calls to deleted/deprecated types and methods of Timefold Solver with their proper alternatives.
- io.moderne.ai.FindAgentsInUse
- Find AI agents configuration files
- Scans codebases to identify usage of AI agents by looking at the agent configuration files present in the repository.
- io.moderne.ai.FindLibrariesInUse
- Find AI libraries in use
- Scans codebases to identify usage of AI services. Detects AI libraries across Java dependencies. Useful for auditing and understanding AI integration patterns.
- io.moderne.ai.FindModelsInUse
- Find AI models in use
- Scans codebases to identify usage of Large Language Models (LLMs). Detects model references and configuration patterns across Java classes, properties files, YAML configs... Useful for identifying model usage.
- io.moderne.ai.FixMisencodedCommentsInFrench
- Fix mis-encoded French comments, javadocs and pom.xml comments
- Fixes mis-encoded French comments in your code, javadocs and in your pom.xml files. Mis-encoded comments contain a ? or � character.
- io.moderne.cryptography.PostQuantumCryptography
- Post quantum cryptography
- This recipe searches for instances in code that may be impacted by post quantum cryptography. Applications may need to support larger key sizes, different algorithms, or use crypto agility to handle the migration. The recipe includes detection of hardcoded values that affect behavior in a post-quantum world, programmatic configuration that may prevent algorithm changes, and general cryptographic usage patterns that should be reviewed.
- io.moderne.devcenter.ApacheDevCenter
- DevCenter for Apache
- A DevCenter that tracks the latest Apache Maven parent POM versions and applies best practices.
- io.moderne.devcenter.ApacheMavenDevCenter
- DevCenter for Apache Maven
- A DevCenter that tracks the latest Apache Maven parent POM versions and applies best practices. This DevCenter includes recipes to upgrade the parent POMs of Apache Maven, as well as a collection of best practices for Maven POMs.
- io.moderne.devcenter.BuildToolStarter
- DevCenter for Gradle and Maven
- Track and automate upgrades for Gradle, Maven, and Java versions.
- io.moderne.devcenter.DevCenterStarter
- DevCenter
- This is a default DevCenter configuration that can be used as a starting point for your own DevCenter configuration. It includes a combination of upgrades, migrations, and security fixes. You can customize this configuration to suit your needs. For more information on how to customize your DevCenter configuration, see the DevCenter documentation.
- io.moderne.devcenter.QuarkusDevCenter
- DevCenter for Quarkus
- A DevCenter that tracks the latest Quarkus framework versions and applies best practices. This DevCenter includes recipes to upgrade Quarkus versions, migrate from deprecated APIs, and ensure compatibility with the latest Java versions and testing frameworks.
- io.moderne.devcenter.UpgradeApacheParent
- Upgrade Apache Parent POM
- Upgrades the Apache parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenParent
- Upgrade Apache Maven Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenPluginsParent
- Upgrade Maven Plugins Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenSharedParent
- Upgrade Maven Shared Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeQuarkus3_x
- Upgrade to Quarkus 3.26
- Upgrades Quarkus dependencies to version 3.26.x, including core, extensions, and tooling.
- io.moderne.devcenter.UpgradeQuarkusUniverseBom
- Upgrade Quarkus Universe BOM
- Upgrades the Quarkus Universe BOM parent to the latest version.
- io.moderne.devcenter.VulnerabilitiesDevCenter
- DevCenter for Vulnerability Management
- Recipes to analyze and manage dependency vulnerabilities using Moderne DevCenter.
- io.moderne.jasperreports.UpgradeToJasperReports6
- Migrate to JasperReports 6
- Migrates JasperReports from 5.x to 6.x with the new exporter API, XLS to XLSX move, and removal of Spring JasperReports views.
- io.moderne.java.spring.boot.SpringToSpringBoot
- Migrate Spring Framework to Spring Boot
- Migrate non Spring Boot applications to the latest compatible Spring Boot release. This recipe will modify an application's build files introducing Maven dependency management for Spring Boot, or adding the Gradle Spring Boot build plugin.
- io.moderne.java.spring.boot3.SpringBoot3BestPractices
- Spring Boot 3.5 best practices
- Applies best practices to Spring Boot 3.5+ applications.
- io.moderne.java.spring.boot4.UpgradeSpringBoot_4_0
- Migrate to Spring Boot 4.0 (Moderne Edition)
- Migrate applications to the latest Spring Boot 4.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 4.0.
- org.apache.wicket.BestPractices
- Wicket best practices
- Applies Wicket best practices such as minimizing anonymous inner classes and upgrading to the latest version.
- org.axonframework.migration.UpgradeAxonFramework_4_Jakarta
- Upgrade to Axonframework 4.x Jakarta
- Migration file to upgrade from an Axon Framework Javax-specific project to Jakarta.
- org.axonframework.migration.UpgradeAxonFramework_4_Javax
- Upgrade to Axonframework 4.x Javax
- Migration file to upgrade an Axon Framework Javax-specific project and remain on Javax.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_7
- Migrate to Android Gradle Plugin 8.7
- Recipes to migrate to Android Gradle Plugin version 8.7.
- org.openrewrite.android.UpgradeToAndroidSDK35
- Upgrade to Android SDK 35
- Recipes to upgrade to Android SDK version 35.
- org.openrewrite.apache.commons.collections.UpgradeApacheCommonsCollections_3_4
- Migrates to Apache Commons Collections 4.x
- Migrate applications to the latest Apache Commons Collections 4.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.apache.commons.io.RelocateApacheCommonsIo
- Relocate
org.apache.commons:commons-iotocommons-io:commons-io - The deployment of
org.apache.commons:commons-iowas a publishing mistake around 2012 which was corrected by changing the deployment GAV to be located undercommons-io:commons-io.
- Relocate
- org.openrewrite.apache.commons.io.UseStandardCharsets
- Prefer
java.nio.charset.StandardCharsets - Prefer the Java standard library's
java.nio.charset.StandardCharsetsover third-party usage of apache'sorg.apache.commons.io.Charsets.
- Prefer
- org.openrewrite.apache.commons.io.UseSystemLineSeparator
- Prefer
System.lineSeparator() - Prefer the Java standard library's
System.lineSeparator()over third-party usage of apache'sIOUtils.LINE_SEPARATOR.
- Prefer
- org.openrewrite.apache.commons.math.UpgradeApacheCommonsMath_2_3
- Migrates to Apache Commons Math 3.x
- Migrate applications to the latest Apache Commons Math 3.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.apache.poi.UpgradeApachePoi_3_17
- Migrates to Apache POI 3.17
- Migrates to the last Apache POI 3.x release. This recipe modifies build files and makes changes to deprecated/preferred APIs that have changed between versions.
- org.openrewrite.codemods.cleanup.javascript.ArrowBodyStyle
- Require braces around arrow function bodies
- Require braces around arrow function bodies See rule details.
- org.openrewrite.codemods.cleanup.javascript.BetterRegex
- Improve regexes by making them shorter, consistent, and safer
- Improve regexes by making them shorter, consistent, and safer. See rule details.
- org.openrewrite.codemods.cleanup.javascript.CapitalizedComments
- Enforce or disallow capitalization of the first letter of a comment
- Enforce or disallow capitalization of the first letter of a comment See rule details.
- org.openrewrite.codemods.cleanup.javascript.CatchErrorName
- Enforce a specific parameter name in catch clauses
- Enforce a specific parameter name in catch clauses. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ConsistentDestructuring
- Use destructured variables over properties
- Use destructured variables over properties. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ConsistentTypeSpecifierStyle
- Enforce or ban the use of inline type-only markers for named imports
- Enforce or ban the use of inline type-only markers for named imports See rule details for import/consistent-type-specifier-style.
- org.openrewrite.codemods.cleanup.javascript.Curly
- Enforce consistent brace style for all control statements
- Enforce consistent brace style for all control statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.CustomErrorDefinition
- Enforce correct
Errorsubclassing - Enforce correct
Errorsubclassing. See rule details.
- Enforce correct
- org.openrewrite.codemods.cleanup.javascript.DotNotation
- Enforce dot notation whenever possible
- Enforce dot notation whenever possible See rule details.
- org.openrewrite.codemods.cleanup.javascript.EmptyBraceSpaces
- Enforce no spaces between braces
- Enforce no spaces between braces. See rule details.
- org.openrewrite.codemods.cleanup.javascript.Eqeqeq
- Require the use of
===and!== - Require the use of
===and!==See rule details.
- Require the use of
- org.openrewrite.codemods.cleanup.javascript.EscapeCase
- Require escape sequences to use uppercase values
- Require escape sequences to use uppercase values. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ExplicitLengthCheck
- Enforce explicitly comparing the length or size property of a value
- Enforce explicitly comparing the length or size property of a value. See rule details.
- org.openrewrite.codemods.cleanup.javascript.First
- Ensure all imports appear before other statements
- Ensure all imports appear before other statements See rule details for import/first.
- org.openrewrite.codemods.cleanup.javascript.LogicalAssignmentOperators
- Require or disallow logical assignment operator shorthand
- Require or disallow logical assignment operator shorthand See rule details.
- org.openrewrite.codemods.cleanup.javascript.MultilineCommentStyle
- Enforce a particular style for multiline comments
- Enforce a particular style for multiline comments See rule details.
- org.openrewrite.codemods.cleanup.javascript.NewForBuiltins
- Enforce the use of
newfor all builtins, exceptString,Number,Boolean,Symbol, andBigInt - Enforce the use of
newfor all builtins, exceptString,Number,Boolean,Symbol, andBigInt. See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.NewlineAfterImport
- Enforce a newline after import statements
- Enforce a newline after import statements See rule details for import/newline-after-import.
- org.openrewrite.codemods.cleanup.javascript.NoAbsolutePath
- Forbid import of modules using absolute paths
- Forbid import of modules using absolute paths See rule details for import/no-absolute-path.
- org.openrewrite.codemods.cleanup.javascript.NoArrayForEach
- Prefer
for…ofover theforEachmethod - Prefer
for…ofover theforEachmethod. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.NoArrayMethodThisArgument
- Disallow using the
thisargument in array methods - Disallow using the
thisargument in array methods. See rule details.
- Disallow using the
- org.openrewrite.codemods.cleanup.javascript.NoArrayPushPush
- Enforce combining multiple
Array#push()into one call - Enforce combining multiple
Array#push()into one call. See rule details.
- Enforce combining multiple
- org.openrewrite.codemods.cleanup.javascript.NoAwaitExpressionMember
- Disallow member access from
awaitexpression - Disallow member access from
awaitexpression. See rule details.
- Disallow member access from
- org.openrewrite.codemods.cleanup.javascript.NoConsoleSpaces
- Do not use leading/trailing space between
console.logparameters - Do not use leading/trailing space between
console.logparameters. See rule details.
- Do not use leading/trailing space between
- org.openrewrite.codemods.cleanup.javascript.NoDivRegex
- Disallow equal signs explicitly at the beginning of regular expressions
- Disallow equal signs explicitly at the beginning of regular expressions See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoDuplicates
- Forbid repeated import of the same module in multiple places
- Forbid repeated import of the same module in multiple places See rule details for import/no-duplicates.
- org.openrewrite.codemods.cleanup.javascript.NoElseReturn
- Disallow else blocks after return statements in if statements
- Disallow else blocks after return statements in if statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoEmptyNamedBlocks
- Forbid empty named import
- Forbid empty named import See rule details for import/no-empty-named-blocks.
- org.openrewrite.codemods.cleanup.javascript.NoExtraBind
- Disallow unnecessary calls to
.bind() - Disallow unnecessary calls to
.bind()See rule details.
- Disallow unnecessary calls to
- org.openrewrite.codemods.cleanup.javascript.NoExtraLabel
- Disallow unnecessary labels
- Disallow unnecessary labels See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoForLoop
- Do not use a
forloop that can be replaced with afor-ofloop - Do not use a
forloop that can be replaced with afor-ofloop. See rule details.
- Do not use a
- org.openrewrite.codemods.cleanup.javascript.NoHexEscape
- Enforce the use of Unicode escapes instead of hexadecimal escapes
- Enforce the use of Unicode escapes instead of hexadecimal escapes. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoImplicitCoercion
- Disallow shorthand type conversions
- Disallow shorthand type conversions See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoImportModuleExports
- Forbid import statements with CommonJS module.exports
- Forbid import statements with CommonJS module.exports See rule details for import/no-import-module-exports.
- org.openrewrite.codemods.cleanup.javascript.NoInstanceofArray
- Require
Array.isArray()instead ofinstanceof Array - Require
Array.isArray()instead ofinstanceof Array. See rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.NoLonelyIf
- Disallow if statements as the only statement in else blocks
- Disallow if statements as the only statement in else blocks See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNamespace
- Forbid namespace (a.k.a. "wildcard"
*) imports - Forbid namespace (a.k.a. "wildcard"
*) imports. See rule details for import/no-namespace.
- Forbid namespace (a.k.a. "wildcard"
- org.openrewrite.codemods.cleanup.javascript.NoNegatedCondition
- Disallow negated conditions
- Disallow negated conditions. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNestedTernary
- Disallow nested ternary expressions
- Disallow nested ternary expressions. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNewArray
- Disallow
new Array() - Disallow
new Array(). See rule details.
- Disallow
- org.openrewrite.codemods.cleanup.javascript.NoNewBuffer
- Enforce the use of
Buffer.from()andBuffer.alloc()instead of the deprecatednew Buffer() - Enforce the use of
Buffer.from()andBuffer.alloc()instead of the deprecatednew Buffer(). See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.NoNull
- Disallow the use of the
nullliteral - Disallow the use of the
nullliteral. See rule details.
- Disallow the use of the
- org.openrewrite.codemods.cleanup.javascript.NoRelativePackages
- Forbid importing packages through relative paths
- Forbid importing packages through relative paths See rule details for import/no-relative-packages.
- org.openrewrite.codemods.cleanup.javascript.NoStaticOnlyClass
- Disallow classes that only have static members
- Disallow classes that only have static members. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoTypeofUndefined
- Disallow comparing
undefinedusingtypeof - Disallow comparing
undefinedusingtypeof. See rule details.
- Disallow comparing
- org.openrewrite.codemods.cleanup.javascript.NoUndefInit
- Disallow initializing variables to undefined
- Disallow initializing variables to undefined See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnnecessaryAwait
- Disallow awaiting non-promise values
- Disallow awaiting non-promise values. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnneededTernary
- Disallow ternary operators when simpler alternatives exist
- Disallow ternary operators when simpler alternatives exist See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnreadableArrayDestructuring
- Disallow unreadable array destructuring
- Disallow unreadable array destructuring. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessComputedKey
- Disallow unnecessary computed property keys in objects and classes
- Disallow unnecessary computed property keys in objects and classes See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessFallbackInSpread
- Disallow useless fallback when spreading in object literals
- Disallow useless fallback when spreading in object literals. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessLengthCheck
- Disallow useless array
lengthcheck - Disallow useless array
lengthcheck. See rule details.
- Disallow useless array
- org.openrewrite.codemods.cleanup.javascript.NoUselessPathSegments
- Forbid unnecessary path segments in import and require statements
- Forbid unnecessary path segments in import and require statements See rule details for import/no-useless-path-segments.
- org.openrewrite.codemods.cleanup.javascript.NoUselessPromiseResolveReject
- Disallow returning/yielding
Promise.resolve()/reject()inasyncfunctions or promise callbacks - Disallow returning/yielding
Promise.resolve()/reject()inasyncfunctions or promise callbacks. See rule details.
- Disallow returning/yielding
- org.openrewrite.codemods.cleanup.javascript.NoUselessRename
- Disallow renaming import, export, and destructured assignments to the same name
- Disallow renaming import, export, and destructured assignments to the same name See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessReturn
- Disallow redundant return statements
- Disallow redundant return statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessSpread
- Disallow unnecessary spread
- Disallow unnecessary spread. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessUndefined
- Disallow useless
undefined - Disallow useless
undefined. See rule details.
- Disallow useless
- org.openrewrite.codemods.cleanup.javascript.NoVar
- Require
letorconstinstead ofvar - Require
letorconstinstead ofvarSee rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.NoZeroFractions
- Disallow number literals with zero fractions or dangling dots
- Disallow number literals with zero fractions or dangling dots. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NumberLiteralCase
- Enforce proper case for numeric literals
- Enforce proper case for numeric literals. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NumericSeparatorsStyle
- Enforce the style of numeric separators by correctly grouping digits
- Enforce the style of numeric separators by correctly grouping digits. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ObjectShorthand
- Require or disallow method and property shorthand syntax for object literals
- Require or disallow method and property shorthand syntax for object literals See rule details.
- org.openrewrite.codemods.cleanup.javascript.OneVar
- Enforce variables to be declared either together or separately in functions
- Enforce variables to be declared either together or separately in functions See rule details.
- org.openrewrite.codemods.cleanup.javascript.OperatorAssignment
- Require or disallow assignment operator shorthand where possible
- Require or disallow assignment operator shorthand where possible See rule details.
- org.openrewrite.codemods.cleanup.javascript.Order
- Enforce a convention in module import order
- Enforce a convention in module import order See rule details for import/order.
- org.openrewrite.codemods.cleanup.javascript.PreferAddEventListener
- Prefer
.addEventListener()and.removeEventListener()over on-functions - Prefer
.addEventListener()and.removeEventListener()over on-functions. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFind
- Prefer
.find()and.findLast()over the first or last element from.filter() - Prefer
.find()and.findLast()over the first or last element from.filter(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFlat
- Prefer
Array#flat()over legacy techniques to flatten arrays - Prefer
Array#flat()over legacy techniques to flatten arrays. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFlatMap
- Prefer
.flatMap()over.map().flat() - Prefer
.flatMap()over.map().flat(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayIndexOf
- Prefer
Array#{indexOf,lastIndexOf}()overArray#{findIndex,findLastIndex}()when looking for the index of an item - Prefer
Array#{indexOf,lastIndexOf}()overArray#{findIndex,findLastIndex}()when looking for the index of an item. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArraySome
- Prefer
.some()over.filter().lengthcheck and.{find,findLast}() - Prefer
.some()over.filter().lengthcheck and.{find,findLast}(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrowCallback
- Require using arrow functions for callbacks
- Require using arrow functions for callbacks See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferAt
- Prefer
.at()method for index access andString#charAt() - Prefer
.at()method for index access andString#charAt(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferConst
- Require const declarations for variables that are never reassigned after declared
- Require const declarations for variables that are never reassigned after declared See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDateNow
- Prefer
Date.now()to get the number of milliseconds since the Unix Epoch - Prefer
Date.now()to get the number of milliseconds since the Unix Epoch. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferDefaultParameters
- Prefer default parameters over reassignment
- Prefer default parameters over reassignment. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDestructuring
- Require destructuring from arrays and/or objects
- Require destructuring from arrays and/or objects See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeAppend
- Prefer
Node#append()overNode#appendChild() - Prefer
Node#append()overNode#appendChild(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeDataset
- Prefer using
.dataseton DOM elements over calling attribute methods - Prefer using
.dataseton DOM elements over calling attribute methods. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeRemove
- Prefer
childNode.remove()overparentNode.removeChild(childNode) - Prefer
childNode.remove()overparentNode.removeChild(childNode). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferExponentiationOperator
- Disallow the use of
Math.powin favor of the ** operator - Disallow the use of
Math.powin favor of the ** operator See rule details.
- Disallow the use of
- org.openrewrite.codemods.cleanup.javascript.PreferExportFrom
- Prefer
export…fromwhen re-exporting - Prefer
export…fromwhen re-exporting. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferIncludes
- Prefer
.includes()over.indexOf()andArray#some()when checking for existence or non-existence - Prefer
.includes()over.indexOf()andArray#some()when checking for existence or non-existence. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferJsonParseBuffer
- Prefer reading a JSON file as a buffer
- Prefer reading a JSON file as a buffer. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferKeyboardEventKey
- Prefer
KeyboardEvent#keyoverKeyboardEvent#keyCode - Prefer
KeyboardEvent#keyoverKeyboardEvent#keyCode. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferMathTrunc
- Enforce the use of
Math.trunc()instead of bitwise operators - Enforce the use of
Math.trunc()instead of bitwise operators. See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.PreferModernDomApis
- Prefer
.before()over.insertBefore(),.replaceWith()over.replaceChild(), prefer one of.before(),.after(),.append()or.prepend()overinsertAdjacentText()andinsertAdjacentElement() - Prefer
.before()over.insertBefore(),.replaceWith()over.replaceChild(), prefer one of.before(),.after(),.append()or.prepend()overinsertAdjacentText()andinsertAdjacentElement(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferModernMathApis
- Prefer modern Math APIs over legacy patterns
- Prefer modern Math APIs over legacy patterns. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferModule
- Prefer JavaScript modules (ESM) over CommonJS
- Prefer JavaScript modules (ESM) over CommonJS. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferNativeCoercionFunctions
- Prefer using
String,Number,BigInt,Boolean, andSymboldirectly - Prefer using
String,Number,BigInt,Boolean, andSymboldirectly. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferNegativeIndex
- Prefer negative index over
.length - indexwhen possible - Prefer negative index over
.length - indexwhen possible. See rule details.
- Prefer negative index over
- org.openrewrite.codemods.cleanup.javascript.PreferNodeProtocol
- Prefer using the
node:protocol when importing Node.js builtin modules - Prefer using the
node:protocol when importing Node.js builtin modules. See rule details.
- Prefer using the
- org.openrewrite.codemods.cleanup.javascript.PreferNumberProperties
- Prefer
Numberstatic properties over global ones - Prefer
Numberstatic properties over global ones. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferNumericLiterals
- Disallow
parseInt()andNumber.parseInt()in favor of binary, octal, and hexadecimal literals - Disallow
parseInt()andNumber.parseInt()in favor of binary, octal, and hexadecimal literals See rule details.
- Disallow
- org.openrewrite.codemods.cleanup.javascript.PreferObjectFromEntries
- Prefer using
Object.fromEntries()to transform a list of key-value pairs into an object - Prefer using
Object.fromEntries()to transform a list of key-value pairs into an object. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferObjectHasOwn
- Disallow use of
Object.prototype.hasOwnProperty.call()and prefer use ofObject.hasOwn() - Disallow use of
Object.prototype.hasOwnProperty.call()and prefer use ofObject.hasOwn() See rule details.
- Disallow use of
- org.openrewrite.codemods.cleanup.javascript.PreferObjectSpread
- Disallow using
Object.assignwith an object literal as the first argument and prefer the use of object spread instead - Disallow using
Object.assignwith an object literal as the first argument and prefer the use of object spread instead See rule details.
- Disallow using
- org.openrewrite.codemods.cleanup.javascript.PreferOptionalCatchBinding
- Prefer omitting the catch binding parameter
- Prefer omitting the catch binding parameter. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferPrototypeMethods
- Prefer borrowing methods from the prototype instead of the instance
- Prefer borrowing methods from the prototype instead of the instance. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferQuerySelector
- Prefer
.querySelector()over.getElementById(),.querySelectorAll()over.getElementsByClassName()and.getElementsByTagName() - Prefer
.querySelector()over.getElementById(),.querySelectorAll()over.getElementsByClassName()and.getElementsByTagName(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferReflectApply
- Prefer
Reflect.apply()overFunction#apply() - Prefer
Reflect.apply()overFunction#apply(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferRegexpTest
- Prefer
RegExp#test()overString#match()andRegExp#exec() - Prefer
RegExp#test()overString#match()andRegExp#exec(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSetHas
- Prefer
Set#has()overArray#includes()when checking for existence or non-existence - Prefer
Set#has()overArray#includes()when checking for existence or non-existence. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSetSize
- Prefer using
Set#sizeinstead ofArray#length - Prefer using
Set#sizeinstead ofArray#length. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferSpread
- Prefer the spread operator over
Array.from(),Array#concat(),Array#{slice,toSpliced}()andString#split('') - Prefer the spread operator over
Array.from(),Array#concat(),Array#{slice,toSpliced}()andString#split(''). See rule details.
- Prefer the spread operator over
- org.openrewrite.codemods.cleanup.javascript.PreferStringReplaceAll
- Prefer
String#replaceAll()over regex searches with the global flag - Prefer
String#replaceAll()over regex searches with the global flag. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringSlice
- Prefer
String#slice()overString#substr()andString#substring() - Prefer
String#slice()overString#substr()andString#substring(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringStartsEndsWith
- Prefer
String#startsWith()&String#endsWith()overRegExp#test() - Prefer
String#startsWith()&String#endsWith()overRegExp#test(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringTrimStartEnd
- Prefer
String#trimStart()/String#trimEnd()overString#trimLeft()/String#trimRight() - Prefer
String#trimStart()/String#trimEnd()overString#trimLeft()/String#trimRight(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSwitch
- Prefer
switchover multipleelse-if - Prefer
switchover multipleelse-if. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferTemplate
- Require template literals instead of string concatenation
- Require template literals instead of string concatenation See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferTernary
- Prefer ternary expressions over simple
if-elsestatements - Prefer ternary expressions over simple
if-elsestatements. See rule details.
- Prefer ternary expressions over simple
- org.openrewrite.codemods.cleanup.javascript.PreferTypeError
- Enforce throwing
TypeErrorin type checking conditions - Enforce throwing
TypeErrorin type checking conditions. See rule details.
- Enforce throwing
- org.openrewrite.codemods.cleanup.javascript.PreventAbbreviations
- Prevent abbreviations
- Prevent abbreviations. See rule details.
- org.openrewrite.codemods.cleanup.javascript.RelativeUrlStyle
- Enforce consistent relative URL style
- Enforce consistent relative URL style. See rule details.
- org.openrewrite.codemods.cleanup.javascript.RequireArrayJoinSeparator
- Enforce using the separator argument with
Array#join() - Enforce using the separator argument with
Array#join(). See rule details.
- Enforce using the separator argument with
- org.openrewrite.codemods.cleanup.javascript.RequireNumberToFixedDigitsArgument
- Enforce using the digits argument with
Number#toFixed() - Enforce using the digits argument with
Number#toFixed(). See rule details.
- Enforce using the digits argument with
- org.openrewrite.codemods.cleanup.javascript.SortImports
- Enforce sorted import declarations within modules
- Enforce sorted import declarations within modules See rule details.
- org.openrewrite.codemods.cleanup.javascript.SortVars
- Require variables within the same declaration block to be sorted
- Require variables within the same declaration block to be sorted See rule details.
- org.openrewrite.codemods.cleanup.javascript.Strict
- Require or disallow strict mode directives
- Require or disallow strict mode directives See rule details.
- org.openrewrite.codemods.cleanup.javascript.StringContent
- Enforce better string content
- Enforce better string content. See rule details.
- org.openrewrite.codemods.cleanup.javascript.SwitchCaseBraces
- Enforce consistent brace style for case clauses
- Enforce consistent brace style for case clauses. See rule details.
- org.openrewrite.codemods.cleanup.javascript.TemplateIndent
- Fix whitespace-insensitive template indentation
- Fix whitespace-insensitive template indentation. See rule details.
- org.openrewrite.codemods.cleanup.javascript.TextEncodingIdentifierCase
- Enforce consistent case for text encoding identifiers
- Enforce consistent case for text encoding identifiers. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ThrowNewError
- Require
newwhen throwing an error - Require
newwhen throwing an error. See rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.UnicodeBom
- Require or disallow Unicode byte order mark (BOM)
- Require or disallow Unicode byte order mark (BOM) See rule details.
- org.openrewrite.codemods.cleanup.javascript.Yoda
- Require or disallow "Yoda" conditions
- Require or disallow "Yoda" conditions See rule details.
- org.openrewrite.codemods.cleanup.jest.ConsistentTestIt
- Enforce test and it usage conventions
- Enforce test and it usage conventions See rule details for jest/consistent-test-it.
- org.openrewrite.codemods.cleanup.jest.NoAliasMethods
- Disallow alias methods
- Disallow alias methods See rule details for jest/no-alias-methods.
- org.openrewrite.codemods.cleanup.jest.NoDeprecatedFunctions27
- Disallow use of deprecated functions from before version 27
- Disallow use of deprecated functions from before version 27 See rule details for jest/no-deprecated-functions.
- org.openrewrite.codemods.cleanup.jest.NoJasmineGlobals
- Disallow Jasmine globals
- Disallow Jasmine globals See rule details for jest/no-jasmine-globals.
- org.openrewrite.codemods.cleanup.jest.NoTestPrefixes
- Require using .only and .skip over f and x
- Require using .only and .skip over f and x See rule details for jest/no-test-prefixes.
- org.openrewrite.codemods.cleanup.jest.NoUntypedMockFactory
- Disallow using jest.mock() factories without an explicit type parameter
- Disallow using jest.mock() factories without an explicit type parameter See rule details for jest/no-untyped-mock-factory.
- org.openrewrite.codemods.cleanup.jest.PreferComparisonMatcher
- Suggest using the built-in comparison matchers
- Suggest using the built-in comparison matchers See rule details for jest/prefer-comparison-matcher.
- org.openrewrite.codemods.cleanup.jest.PreferExpectResolves
- Prefer await expect(...).resolves over expect(await ...) syntax
- Prefer await expect(...).resolves over expect(await ...) syntax See rule details for jest/prefer-expect-resolves.
- org.openrewrite.codemods.cleanup.jest.PreferLowercaseTitle
- Enforce lowercase test names
- Enforce lowercase test names See rule details for jest/prefer-lowercase-title.
- org.openrewrite.codemods.cleanup.jest.PreferMockPromiseShorthand
- Prefer mock resolved/rejected shorthands for promises
- Prefer mock resolved/rejected shorthands for promises See rule details for jest/prefer-mock-promise-shorthand.
- org.openrewrite.codemods.cleanup.jest.PreferSpyOn
- Suggest using jest.spyOn()
- Suggest using jest.spyOn() See rule details for jest/prefer-spy-on.
- org.openrewrite.codemods.cleanup.jest.PreferToBe
- Suggest using toBe() for primitive literals
- Suggest using toBe() for primitive literals See rule details for jest/prefer-to-be.
- org.openrewrite.codemods.cleanup.jest.PreferToContain
- Suggest using toContain()
- Suggest using toContain() See rule details for jest/prefer-to-contain.
- org.openrewrite.codemods.cleanup.jest.PreferToHaveLength
- Suggest using toHaveLength()
- Suggest using toHaveLength() See rule details for jest/prefer-to-have-length.
- org.openrewrite.codemods.cleanup.jest.PreferTodo
- Suggest using test.todo
- Suggest using test.todo See rule details for jest/prefer-todo.
- org.openrewrite.codemods.cleanup.jest.RecommendedJestCodeCleanup
- Recommended Jest code cleanup
- Collection of cleanup ESLint rules that are recommended by eslint-plugin-jest.
- org.openrewrite.codemods.cleanup.jest.ValidTitle
- Enforce valid titles
- Enforce valid titles See rule details for jest/valid-title.
- org.openrewrite.codemods.cleanup.react.DestructuringAssignment
- Enforce consistent usage of destructuring assignment of props, state, and context
- Enforce consistent usage of destructuring assignment of props, state, and context See rule details for react/destructuring-assignment.
- org.openrewrite.codemods.cleanup.react.FunctionComponentDefinition
- Enforce a specific function type for function components
- Enforce a specific function type for function components See rule details for react/function-component-definition.
- org.openrewrite.codemods.cleanup.react.JsxBooleanValue
- Enforce boolean attributes notation in JSX
- Enforce boolean attributes notation in JSX See rule details for react/jsx-boolean-value.
- org.openrewrite.codemods.cleanup.react.JsxClosingBracketLocation
- Enforce closing bracket location in JSX
- Enforce closing bracket location in JSX See rule details for react/jsx-closing-bracket-location.
- org.openrewrite.codemods.cleanup.react.JsxClosingTagLocation
- Enforce closing tag location for multiline JSX
- Enforce closing tag location for multiline JSX See rule details for react/jsx-closing-tag-location.
- org.openrewrite.codemods.cleanup.react.JsxCurlyBracePresence
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes See rule details for react/jsx-curly-brace-presence.
- org.openrewrite.codemods.cleanup.react.JsxCurlyNewline
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions See rule details for react/jsx-curly-newline.
- org.openrewrite.codemods.cleanup.react.JsxCurlySpacing
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details for react/jsx-curly-spacing.
- org.openrewrite.codemods.cleanup.react.JsxEqualsSpacing
- Enforce or disallow spaces around equal signs in JSX attributes
- Enforce or disallow spaces around equal signs in JSX attributes See rule details for react/jsx-equals-spacing.
- org.openrewrite.codemods.cleanup.react.JsxFirstPropNewLine
- Enforce proper position of the first property in JSX
- Enforce proper position of the first property in JSX See rule details for react/jsx-first-prop-new-line.
- org.openrewrite.codemods.cleanup.react.JsxFragments
- Enforce shorthand or standard form for React fragments
- Enforce shorthand or standard form for React fragments See rule details for react/jsx-fragments.
- org.openrewrite.codemods.cleanup.react.JsxIndent
- Enforce JSX indentation
- Enforce JSX indentation See rule details for react/jsx-indent.
- org.openrewrite.codemods.cleanup.react.JsxIndentProps
- Enforce props indentation in JSX
- Enforce props indentation in JSX See rule details for react/jsx-indent-props.
- org.openrewrite.codemods.cleanup.react.JsxMaxPropsPerLine
- Enforce maximum of props on a single line in JSX
- Enforce maximum of props on a single line in JSX See rule details for react/jsx-max-props-per-line.
- org.openrewrite.codemods.cleanup.react.JsxNewline
- Require or prevent a new line after jsx elements and expressions
- Require or prevent a new line after jsx elements and expressions See rule details for react/jsx-newline.
- org.openrewrite.codemods.cleanup.react.JsxNoLeakedRender
- Disallow problematic leaked values from being rendered
- Disallow problematic leaked values from being rendered See rule details for react/jsx-no-leaked-render.
- org.openrewrite.codemods.cleanup.react.JsxNoTargetBlank
- Disallow target="_blank" attribute without rel="noreferrer"
- Disallow target="_blank" attribute without rel="noreferrer" See rule details for react/jsx-no-target-blank.
- org.openrewrite.codemods.cleanup.react.JsxNoUselessFragment
- Disallow unnecessary fragments
- Disallow unnecessary fragments See rule details for react/jsx-no-useless-fragment.
- org.openrewrite.codemods.cleanup.react.JsxOneExpressionPerLine
- Require one JSX element per line
- Require one JSX element per line See rule details for react/jsx-one-expression-per-line.
- org.openrewrite.codemods.cleanup.react.JsxPropsNoMultiSpaces
- Disallow multiple spaces between inline JSX props
- Disallow multiple spaces between inline JSX props See rule details for react/jsx-props-no-multi-spaces.
- org.openrewrite.codemods.cleanup.react.JsxSortProps
- Enforce props alphabetical sorting
- Enforce props alphabetical sorting See rule details for react/jsx-sort-props.
- org.openrewrite.codemods.cleanup.react.JsxSpaceBeforeClosing
- Enforce spacing before closing bracket in JSX
- Enforce spacing before closing bracket in JSX See rule details for react/jsx-space-before-closing.
- org.openrewrite.codemods.cleanup.react.JsxTagSpacing
- Enforce whitespace in and around the JSX opening and closing brackets
- Enforce whitespace in and around the JSX opening and closing brackets See rule details for react/jsx-tag-spacing.
- org.openrewrite.codemods.cleanup.react.JsxWrapMultilines
- Disallow missing parentheses around multiline JSX
- Disallow missing parentheses around multiline JSX See rule details for react/jsx-wrap-multilines.
- org.openrewrite.codemods.cleanup.react.NoArrowFunctionLifecycle
- Lifecycle methods should be methods on the prototype, not class fields
- Lifecycle methods should be methods on the prototype, not class fields See rule details for react/no-arrow-function-lifecycle.
- org.openrewrite.codemods.cleanup.react.NoUnknownProperty
- Disallow usage of unknown DOM property
- Disallow usage of unknown DOM property See rule details for react/no-unknown-property.
- org.openrewrite.codemods.cleanup.react.PreferReadOnlyProps
- Enforce that props are read-only
- Enforce that props are read-only See rule details for react/prefer-read-only-props.
- org.openrewrite.codemods.cleanup.react.SelfClosingComp
- Disallow extra closing tags for components without children
- Disallow extra closing tags for components without children See rule details for react/self-closing-comp.
- org.openrewrite.codemods.cleanup.react.SortPropTypes
- Enforce propTypes declarations alphabetical sorting
- Enforce propTypes declarations alphabetical sorting See rule details for react/sort-prop-types.
- org.openrewrite.codemods.cleanup.storybook.AwaitInteractions
- Interactions should be awaited
- Interactions should be awaited See rule details for storybook/await-interactions.
- org.openrewrite.codemods.cleanup.storybook.DefaultExports
- Story files should have a default export
- Story files should have a default export See rule details for storybook/default-exports.
- org.openrewrite.codemods.cleanup.storybook.HierarchySeparator
- Deprecated hierarchy separator in title property
- Deprecated hierarchy separator in title property See rule details for storybook/hierarchy-separator.
- org.openrewrite.codemods.cleanup.storybook.NoRedundantStoryName
- A story should not have a redundant name property
- A story should not have a redundant name property See rule details for storybook/no-redundant-story-name.
- org.openrewrite.codemods.cleanup.storybook.NoTitlePropertyInMeta
- Do not define a title in meta
- Do not define a title in meta See rule details for storybook/no-title-property-in-meta.
- org.openrewrite.codemods.cleanup.storybook.PreferPascalCase
- Stories should use PascalCase
- Stories should use PascalCase See rule details for storybook/prefer-pascal-case.
- org.openrewrite.codemods.cleanup.storybook.RecommendedStorybookCodeCleanup
- Recommended Storybook code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-storybook.
- org.openrewrite.codemods.cleanup.storybook.UseStorybookExpect
- Use expect from @storybook/jest
- Use expect from @storybook/jest See rule details for storybook/use-storybook-expect.
- org.openrewrite.codemods.cleanup.storybook.UseStorybookTestingLibrary
- Do not use testing-library directly on stories
- Do not use testing-library directly on stories See rule details for storybook/use-storybook-testing-library.
- org.openrewrite.codemods.cleanup.svelte.FirstAttributeLinebreak
- Enforce the location of first attribute
- Enforce the location of first attribute See rule details for svelte/first-attribute-linebreak.
- org.openrewrite.codemods.cleanup.svelte.HtmlClosingBracketSpacing
- Require or disallow a space before tag's closing brackets
- Require or disallow a space before tag's closing brackets See rule details for svelte/html-closing-bracket-spacing.
- org.openrewrite.codemods.cleanup.svelte.HtmlQuotes
- Enforce quotes style of HTML attributes
- Enforce quotes style of HTML attributes See rule details for svelte/html-quotes.
- org.openrewrite.codemods.cleanup.svelte.HtmlSelfClosing
- Enforce self-closing style
- Enforce self-closing style See rule details for svelte/html-self-closing.
- org.openrewrite.codemods.cleanup.svelte.Indent
- Enforce consistent indentation
- Enforce consistent indentation See rule details for svelte/indent.
- org.openrewrite.codemods.cleanup.svelte.MaxAttributesPerLine
- Enforce the maximum number of attributes per line
- Enforce the maximum number of attributes per line See rule details for svelte/max-attributes-per-line.
- org.openrewrite.codemods.cleanup.svelte.MustacheSpacing
- Enforce unified spacing in mustache
- Enforce unified spacing in mustache See rule details for svelte/mustache-spacing.
- org.openrewrite.codemods.cleanup.svelte.NoDynamicSlotName
- Disallow dynamic slot name
- Disallow dynamic slot name See rule details for svelte/no-dynamic-slot-name.
- org.openrewrite.codemods.cleanup.svelte.NoSpacesAroundEqualSignsInAttribute
- Disallow spaces around equal signs in attribute
- Disallow spaces around equal signs in attribute See rule details for svelte/no-spaces-around-equal-signs-in-attribute.
- org.openrewrite.codemods.cleanup.svelte.NoUselessMustaches
- Disallow unnecessary mustache interpolations
- Disallow unnecessary mustache interpolations See rule details for svelte/no-useless-mustaches.
- org.openrewrite.codemods.cleanup.svelte.PreferClassDirective
- Require class directives instead of ternary expressions
- Require class directives instead of ternary expressions See rule details for svelte/prefer-class-directive.
- org.openrewrite.codemods.cleanup.svelte.PreferStyleDirective
- Require style directives instead of style attribute
- Require style directives instead of style attribute See rule details for svelte/prefer-style-directive.
- org.openrewrite.codemods.cleanup.svelte.RecommendedsvelteCodeCleanup
- Recommended svelte code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-svelte.
- org.openrewrite.codemods.cleanup.svelte.RequireStoreReactiveAccess
- Disallow to use of the store itself as an operand. Need to use $ prefix or get function
- Disallow to use of the store itself as an operand. Need to use $ prefix or get function. See rule details for svelte/require-store-reactive-access.
- org.openrewrite.codemods.cleanup.svelte.ShorthandAttribute
- Enforce use of shorthand syntax in attribute
- Enforce use of shorthand syntax in attribute See rule details for svelte/shorthand-attribute.
- org.openrewrite.codemods.cleanup.svelte.ShorthandDirective
- Enforce use of shorthand syntax in directives
- Enforce use of shorthand syntax in directives See rule details for svelte/shorthand-directive.
- org.openrewrite.codemods.cleanup.svelte.SortAttributes
- Enforce order of attributes
- Enforce order of attributes See rule details for svelte/sort-attributes.
- org.openrewrite.codemods.cleanup.svelte.SpacedHtmlComment
- Enforce consistent spacing after the <!-- and before the --> in a HTML comment
- Enforce consistent spacing after the <!-- and before the --> in a HTML comment See rule details for svelte/spaced-html-comment.
- org.openrewrite.codemods.cleanup.vue.ArrayBracketNewline
- Enforce linebreaks after opening and before closing array brackets in
<template> - Enforce linebreaks after opening and before closing array brackets in
<template>See rule details for vue/array-bracket-newline.
- Enforce linebreaks after opening and before closing array brackets in
- org.openrewrite.codemods.cleanup.vue.ArrayBracketSpacing
- Enforce consistent spacing inside array brackets in
<template> - Enforce consistent spacing inside array brackets in
<template>See rule details for vue/array-bracket-spacing.
- Enforce consistent spacing inside array brackets in
- org.openrewrite.codemods.cleanup.vue.ArrayElementNewline
- Enforce line breaks after each array element in
<template> - Enforce line breaks after each array element in
<template>See rule details for vue/array-element-newline.
- Enforce line breaks after each array element in
- org.openrewrite.codemods.cleanup.vue.ArrowSpacing
- Enforce consistent spacing before and after the arrow in arrow functions in
<template> - Enforce consistent spacing before and after the arrow in arrow functions in
<template>See rule details for vue/arrow-spacing.
- Enforce consistent spacing before and after the arrow in arrow functions in
- org.openrewrite.codemods.cleanup.vue.AttributesOrder
- Enforce order of attributes
- Enforce order of attributes See rule details for vue/attributes-order.
- org.openrewrite.codemods.cleanup.vue.BlockOrder
- Enforce order of component top-level elements
- Enforce order of component top-level elements See rule details for vue/block-order.
- org.openrewrite.codemods.cleanup.vue.BlockSpacing
- Disallow or enforce spaces inside of blocks after opening block and before closing block in
<template> - Disallow or enforce spaces inside of blocks after opening block and before closing block in
<template>See rule details for vue/block-spacing.
- Disallow or enforce spaces inside of blocks after opening block and before closing block in
- org.openrewrite.codemods.cleanup.vue.BlockTagNewline
- Enforce line breaks after opening and before closing block-level tags
- Enforce line breaks after opening and before closing block-level tags See rule details for vue/block-tag-newline.
- org.openrewrite.codemods.cleanup.vue.BraceStyle
- Enforce consistent brace style for blocks in
<template> - Enforce consistent brace style for blocks in
<template>See rule details for vue/brace-style.
- Enforce consistent brace style for blocks in
- org.openrewrite.codemods.cleanup.vue.CommaDangle
- Require or disallow trailing commas in
<template> - Require or disallow trailing commas in
<template>See rule details for vue/comma-dangle.
- Require or disallow trailing commas in
- org.openrewrite.codemods.cleanup.vue.CommaSpacing
- Enforce consistent spacing before and after commas in
<template> - Enforce consistent spacing before and after commas in
<template>See rule details for vue/comma-spacing.
- Enforce consistent spacing before and after commas in
- org.openrewrite.codemods.cleanup.vue.CommaStyle
- Enforce consistent comma style in
<template> - Enforce consistent comma style in
<template>See rule details for vue/comma-style.
- Enforce consistent comma style in
- org.openrewrite.codemods.cleanup.vue.ComponentNameInTemplateCasing
- Enforce specific casing for the component naming style in template
- Enforce specific casing for the component naming style in template See rule details for vue/component-name-in-template-casing.
- org.openrewrite.codemods.cleanup.vue.ComponentOptionsNameCasing
- Enforce the casing of component name in components options
- Enforce the casing of component name in components options See rule details for vue/component-options-name-casing.
- org.openrewrite.codemods.cleanup.vue.ComponentTagsOrder
- Enforce order of component top-level elements
- Enforce order of component top-level elements See rule details for vue/component-tags-order.
- org.openrewrite.codemods.cleanup.vue.DefineMacrosOrder
- Enforce order of defineEmits and defineProps compiler macros
- Enforce order of defineEmits and defineProps compiler macros See rule details for vue/define-macros-order.
- org.openrewrite.codemods.cleanup.vue.DotLocation
- Enforce consistent newlines before and after dots in
<template> - Enforce consistent newlines before and after dots in
<template>See rule details for vue/dot-location.
- Enforce consistent newlines before and after dots in
- org.openrewrite.codemods.cleanup.vue.DotNotation
- Enforce dot notation whenever possible in
<template> - Enforce dot notation whenever possible in
<template>See rule details for vue/dot-notation.
- Enforce dot notation whenever possible in
- org.openrewrite.codemods.cleanup.vue.Eqeqeq
- Require the use of === and !== in
<template> - Require the use of === and !== in
<template>See rule details for vue/eqeqeq.
- Require the use of === and !== in
- org.openrewrite.codemods.cleanup.vue.FuncCallSpacing
- Require or disallow spacing between function identifiers and their invocations in
<template> - Require or disallow spacing between function identifiers and their invocations in
<template>See rule details for vue/func-call-spacing.
- Require or disallow spacing between function identifiers and their invocations in
- org.openrewrite.codemods.cleanup.vue.HtmlCommentContentNewline
- Enforce unified line brake in HTML comments
- Enforce unified line brake in HTML comments See rule details for vue/html-comment-content-newline.
- org.openrewrite.codemods.cleanup.vue.HtmlCommentContentSpacing
- Enforce unified spacing in HTML comments
- Enforce unified spacing in HTML comments See rule details for vue/html-comment-content-spacing.
- org.openrewrite.codemods.cleanup.vue.HtmlCommentIndent
- Enforce consistent indentation in HTML comments
- Enforce consistent indentation in HTML comments See rule details for vue/html-comment-indent.
- org.openrewrite.codemods.cleanup.vue.KeySpacing
- Enforce consistent spacing between keys and values in object literal properties in
<template> - Enforce consistent spacing between keys and values in object literal properties in
<template>See rule details for vue/key-spacing.
- Enforce consistent spacing between keys and values in object literal properties in
- org.openrewrite.codemods.cleanup.vue.KeywordSpacing
- Enforce consistent spacing before and after keywords in
<template> - Enforce consistent spacing before and after keywords in
<template>See rule details for vue/keyword-spacing.
- Enforce consistent spacing before and after keywords in
- org.openrewrite.codemods.cleanup.vue.MultilineTernary
- Enforce newlines between operands of ternary expressions in
<template> - Enforce newlines between operands of ternary expressions in
<template>See rule details for vue/multiline-ternary.
- Enforce newlines between operands of ternary expressions in
- org.openrewrite.codemods.cleanup.vue.NewLineBetweenMultiLineProperty
- Enforce new lines between multi-line properties in Vue components
- Enforce new lines between multi-line properties in Vue components See rule details for vue/new-line-between-multi-line-property.
- org.openrewrite.codemods.cleanup.vue.NextTickStyle
- Enforce Promise or callback style in nextTick
- Enforce Promise or callback style in nextTick See rule details for vue/next-tick-style.
- org.openrewrite.codemods.cleanup.vue.NoExtraParens
- Disallow unnecessary parentheses in
<template> - Disallow unnecessary parentheses in
<template>See rule details for vue/no-extra-parens.
- Disallow unnecessary parentheses in
- org.openrewrite.codemods.cleanup.vue.NoRequiredPropWithDefault
- Enforce props with default values to be optional
- Enforce props with default values to be optional See rule details for vue/no-required-prop-with-default.
- org.openrewrite.codemods.cleanup.vue.NoUnsupportedFeatures
- Disallow unsupported Vue.js syntax on the specified version
- Disallow unsupported Vue.js syntax on the specified version See rule details for vue/no-unsupported-features.
- org.openrewrite.codemods.cleanup.vue.NoUselessMustaches
- Disallow unnecessary mustache interpolations
- Disallow unnecessary mustache interpolations See rule details for vue/no-useless-mustaches.
- org.openrewrite.codemods.cleanup.vue.NoUselessVBind
- Disallow unnecessary v-bind directives
- Disallow unnecessary v-bind directives See rule details for vue/no-useless-v-bind.
- org.openrewrite.codemods.cleanup.vue.ObjectCurlyNewline
- Enforce consistent line breaks after opening and before closing braces in
<template> - Enforce consistent line breaks after opening and before closing braces in
<template>See rule details for vue/object-curly-newline.
- Enforce consistent line breaks after opening and before closing braces in
- org.openrewrite.codemods.cleanup.vue.ObjectCurlySpacing
- Enforce consistent spacing inside braces in
<template> - Enforce consistent spacing inside braces in
<template>See rule details for vue/object-curly-spacing.
- Enforce consistent spacing inside braces in
- org.openrewrite.codemods.cleanup.vue.ObjectPropertyNewline
- Enforce placing object properties on separate lines in
<template> - Enforce placing object properties on separate lines in
<template>See rule details for vue/object-property-newline.
- Enforce placing object properties on separate lines in
- org.openrewrite.codemods.cleanup.vue.ObjectShorthand
- Require or disallow method and property shorthand syntax for object literals in
<template> - Require or disallow method and property shorthand syntax for object literals in
<template>See rule details for vue/object-shorthand.
- Require or disallow method and property shorthand syntax for object literals in
- org.openrewrite.codemods.cleanup.vue.OperatorLinebreak
- Enforce consistent linebreak style for operators in
<template> - Enforce consistent linebreak style for operators in
<template>See rule details for vue/operator-linebreak.
- Enforce consistent linebreak style for operators in
- org.openrewrite.codemods.cleanup.vue.OrderInComponents
- Enforce order of properties in components
- Enforce order of properties in components See rule details for vue/order-in-components.
- org.openrewrite.codemods.cleanup.vue.PaddingLineBetweenBlocks
- Require or disallow padding lines between blocks
- Require or disallow padding lines between blocks See rule details for vue/padding-line-between-blocks.
- org.openrewrite.codemods.cleanup.vue.PaddingLineBetweenTags
- Require or disallow newlines between sibling tags in template
- Require or disallow newlines between sibling tags in template See rule details for vue/padding-line-between-tags.
- org.openrewrite.codemods.cleanup.vue.PaddingLinesInComponentDefinition
- Require or disallow padding lines in component definition
- Require or disallow padding lines in component definition See rule details for vue/padding-lines-in-component-definition.
- org.openrewrite.codemods.cleanup.vue.PreferDefineOptions
- Enforce use of defineOptions instead of default export
- Enforce use of defineOptions instead of default export. See rule details for vue/prefer-define-options.
- org.openrewrite.codemods.cleanup.vue.PreferSeparateStaticClass
- Require static class names in template to be in a separate class attribute
- Require static class names in template to be in a separate class attribute See rule details for vue/prefer-separate-static-class.
- org.openrewrite.codemods.cleanup.vue.PreferTemplate
- Require template literals instead of string concatenation in
<template> - Require template literals instead of string concatenation in
<template>See rule details for vue/prefer-template.
- Require template literals instead of string concatenation in
- org.openrewrite.codemods.cleanup.vue.QuoteProps
- Require quotes around object literal property names in
<template> - Require quotes around object literal property names in
<template>See rule details for vue/quote-props.
- Require quotes around object literal property names in
- org.openrewrite.codemods.cleanup.vue.RecommendedVueCodeCleanup
- Recommended vue code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-vue.
- org.openrewrite.codemods.cleanup.vue.ScriptIndent
- Enforce consistent indentation in
<script> - Enforce consistent indentation in
<script>See rule details for vue/script-indent.
- Enforce consistent indentation in
- org.openrewrite.codemods.cleanup.vue.SpaceInParens
- Enforce consistent spacing inside parentheses in
<template> - Enforce consistent spacing inside parentheses in
<template>See rule details for vue/space-in-parens.
- Enforce consistent spacing inside parentheses in
- org.openrewrite.codemods.cleanup.vue.SpaceInfixOps
- Require spacing around infix operators in
<template> - Require spacing around infix operators in
<template>See rule details for vue/space-infix-ops.
- Require spacing around infix operators in
- org.openrewrite.codemods.cleanup.vue.SpaceUnaryOps
- Enforce consistent spacing before or after unary operators in
<template> - Enforce consistent spacing before or after unary operators in
<template>See rule details for vue/space-unary-ops.
- Enforce consistent spacing before or after unary operators in
- org.openrewrite.codemods.cleanup.vue.StaticClassNamesOrder
- Enforce static class names order
- Enforce static class names order See rule details for vue/static-class-names-order.
- org.openrewrite.codemods.cleanup.vue.TemplateCurlySpacing
- Require or disallow spacing around embedded expressions of template strings in
<template> - Require or disallow spacing around embedded expressions of template strings in
<template>See rule details for vue/template-curly-spacing.
- Require or disallow spacing around embedded expressions of template strings in
- org.openrewrite.codemods.cleanup.vue.ThisInTemplate
- Disallow usage of this in template
- Disallow usage of this in template See rule details for vue/this-in-template.
- org.openrewrite.codemods.cleanup.vue.VForDelimiterStyle
- Enforce v-for directive's delimiter style
- Enforce v-for directive's delimiter style See rule details for vue/v-for-delimiter-style.
- org.openrewrite.codemods.cleanup.vue.VIfElseKey
- Require key attribute for conditionally rendered repeated components
- Require key attribute for conditionally rendered repeated components See rule details for vue/v-if-else-key.
- org.openrewrite.codemods.cleanup.vue.VOnHandlerStyle
- Enforce writing style for handlers in v-on directives
- Enforce writing style for handlers in v-on directives See rule details for vue/v-on-handler-style.
- org.openrewrite.codemods.ecmascript.5to6.ECMAScript6BestPractices
- Upgrade ECMAScript 5 to ECMAScript 6
- A collection of common ECMAScript 5 to ECMAScript 6 updates.
- org.openrewrite.codemods.ecmascript.ESLintTypeScriptDefaults
- Lint TypeScript code using ESLint
- The default config includes the
@typescript-eslintplugin and the correspondingplugin:@typescript-eslint/recommendedextend.
- org.openrewrite.codemods.ecmascript.ESLintTypeScriptPrettier
- Format TypeScript using ESLint Prettier plugin
- Formats all TypeScript source code using the ESLint Prettier plugin.
- org.openrewrite.codemods.format.ArrayBracketNewline
- Enforce linebreaks after opening and before closing array brackets
- Enforce linebreaks after opening and before closing array brackets See rule details.
- org.openrewrite.codemods.format.ArrayBracketSpacing
- Enforce consistent spacing inside array brackets
- Enforce consistent spacing inside array brackets See rule details.
- org.openrewrite.codemods.format.ArrayElementNewline
- Enforce line breaks after each array element
- Enforce line breaks after each array element See rule details.
- org.openrewrite.codemods.format.ArrowParens
- Require parentheses around arrow function arguments
- Require parentheses around arrow function arguments See rule details.
- org.openrewrite.codemods.format.ArrowSpacing
- Enforce consistent spacing before and after the arrow in arrow functions
- Enforce consistent spacing before and after the arrow in arrow functions See rule details.
- org.openrewrite.codemods.format.BlockSpacing
- Disallow or enforce spaces inside of blocks after opening block and before closing block
- Disallow or enforce spaces inside of blocks after opening block and before closing block See rule details.
- org.openrewrite.codemods.format.BraceStyle
- Enforce consistent brace style for blocks
- Enforce consistent brace style for blocks See rule details.
- org.openrewrite.codemods.format.CommaDangle
- Require or disallow trailing commas
- Require or disallow trailing commas See rule details.
- org.openrewrite.codemods.format.CommaSpacing
- Enforce consistent spacing before and after commas
- Enforce consistent spacing before and after commas See rule details.
- org.openrewrite.codemods.format.CommaStyle
- Enforce consistent comma style
- Enforce consistent comma style See rule details.
- org.openrewrite.codemods.format.ComputedPropertySpacing
- Enforce consistent spacing inside computed property brackets
- Enforce consistent spacing inside computed property brackets See rule details.
- org.openrewrite.codemods.format.DotLocation
- Enforce consistent newlines before and after dots
- Enforce consistent newlines before and after dots See rule details.
- org.openrewrite.codemods.format.EolLast
- Require or disallow newline at the end of files
- Require or disallow newline at the end of files See rule details.
- org.openrewrite.codemods.format.FuncCallSpacing
- Require or disallow spacing between function identifiers and their invocations. Alias of `function-call-spacing`
- Require or disallow spacing between function identifiers and their invocations. Alias of `function-call-spacing`. See rule details.
- org.openrewrite.codemods.format.FunctionCallArgumentNewline
- Enforce line breaks between arguments of a function call
- Enforce line breaks between arguments of a function call See rule details.
- org.openrewrite.codemods.format.FunctionCallSpacing
- Require or disallow spacing between function identifiers and their invocations
- Require or disallow spacing between function identifiers and their invocations See rule details.
- org.openrewrite.codemods.format.FunctionParenNewline
- Enforce consistent line breaks inside function parentheses
- Enforce consistent line breaks inside function parentheses See rule details.
- org.openrewrite.codemods.format.GeneratorStarSpacing
- Enforce consistent spacing around `*` operators in generator functions
- Enforce consistent spacing around `*` operators in generator functions See rule details.
- org.openrewrite.codemods.format.ImplicitArrowLinebreak
- Enforce the location of arrow function bodies
- Enforce the location of arrow function bodies See rule details.
- org.openrewrite.codemods.format.Indent
- Enforce consistent indentation
- Enforce consistent indentation See rule details.
- org.openrewrite.codemods.format.IndentBinaryOps
- Indentation for binary operators
- Indentation for binary operators See rule details.
- org.openrewrite.codemods.format.JsxClosingBracketLocation
- Enforce closing bracket location in JSX
- Enforce closing bracket location in JSX See rule details.
- org.openrewrite.codemods.format.JsxClosingTagLocation
- Enforce closing tag location for multiline JSX
- Enforce closing tag location for multiline JSX See rule details.
- org.openrewrite.codemods.format.JsxCurlyBracePresence
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes See rule details.
- org.openrewrite.codemods.format.JsxCurlyNewline
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions See rule details.
- org.openrewrite.codemods.format.JsxCurlySpacing
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details.
- org.openrewrite.codemods.format.JsxEqualsSpacing
- Enforce or disallow spaces around equal signs in JSX attributes
- Enforce or disallow spaces around equal signs in JSX attributes See rule details.
- org.openrewrite.codemods.format.JsxFirstPropNewLine
- Enforce proper position of the first property in JSX
- Enforce proper position of the first property in JSX See rule details.
- org.openrewrite.codemods.format.JsxIndent
- Enforce JSX indentation
- Enforce JSX indentation See rule details.
- org.openrewrite.codemods.format.JsxIndentProps
- Enforce props indentation in JSX
- Enforce props indentation in JSX See rule details.
- org.openrewrite.codemods.format.JsxMaxPropsPerLine
- Enforce maximum of props on a single line in JSX
- Enforce maximum of props on a single line in JSX See rule details.
- org.openrewrite.codemods.format.JsxNewline
- Require or prevent a new line after jsx elements and expressions
- Require or prevent a new line after jsx elements and expressions. See rule details.
- org.openrewrite.codemods.format.JsxOneExpressionPerLine
- Require one JSX element per line
- Require one JSX element per line See rule details.
- org.openrewrite.codemods.format.JsxPascalCase
- Enforce PascalCase for user-defined JSX components
- Enforce PascalCase for user-defined JSX components See rule details.
- org.openrewrite.codemods.format.JsxPropsNoMultiSpaces
- Disallow multiple spaces between inline JSX props
- Disallow multiple spaces between inline JSX props See rule details.
- org.openrewrite.codemods.format.JsxQuotes
- Enforce the consistent use of either double or single quotes in JSX attributes
- Enforce the consistent use of either double or single quotes in JSX attributes See rule details.
- org.openrewrite.codemods.format.JsxSelfClosingComp
- Disallow extra closing tags for components without children
- Disallow extra closing tags for components without children See rule details.
- org.openrewrite.codemods.format.JsxSortProps
- Enforce props alphabetical sorting
- Enforce props alphabetical sorting See rule details.
- org.openrewrite.codemods.format.JsxTagSpacing
- Enforce whitespace in and around the JSX opening and closing brackets
- Enforce whitespace in and around the JSX opening and closing brackets See rule details.
- org.openrewrite.codemods.format.JsxWrapMultilines
- Disallow missing parentheses around multiline JSX
- Disallow missing parentheses around multiline JSX See rule details.
- org.openrewrite.codemods.format.KeySpacing
- Enforce consistent spacing between keys and values in object literal properties
- Enforce consistent spacing between keys and values in object literal properties See rule details.
- org.openrewrite.codemods.format.KeywordSpacing
- Enforce consistent spacing before and after keywords
- Enforce consistent spacing before and after keywords See rule details.
- org.openrewrite.codemods.format.LinebreakStyle
- Enforce consistent linebreak style
- Enforce consistent linebreak style See rule details.
- org.openrewrite.codemods.format.LinesAroundComment
- Require empty lines around comments
- Require empty lines around comments See rule details.
- org.openrewrite.codemods.format.LinesBetweenClassMembers
- Require or disallow an empty line between class members
- Require or disallow an empty line between class members See rule details.
- org.openrewrite.codemods.format.MemberDelimiterStyle
- Require a specific member delimiter style for interfaces and type literals
- Require a specific member delimiter style for interfaces and type literals See rule details.
- org.openrewrite.codemods.format.MultilineTernary
- Enforce newlines between operands of ternary expressions
- Enforce newlines between operands of ternary expressions See rule details.
- org.openrewrite.codemods.format.NewParens
- Enforce or disallow parentheses when invoking a constructor with no arguments
- Enforce or disallow parentheses when invoking a constructor with no arguments See rule details.
- org.openrewrite.codemods.format.NewlinePerChainedCall
- Require a newline after each call in a method chain
- Require a newline after each call in a method chain See rule details.
- org.openrewrite.codemods.format.NoConfusingArrow
- Disallow arrow functions where they could be confused with comparisons
- Disallow arrow functions where they could be confused with comparisons See rule details.
- org.openrewrite.codemods.format.NoExtraParens
- Disallow unnecessary parentheses
- Disallow unnecessary parentheses See rule details.
- org.openrewrite.codemods.format.NoExtraSemi
- Disallow unnecessary semicolons
- Disallow unnecessary semicolons See rule details.
- org.openrewrite.codemods.format.NoFloatingDecimal
- Disallow leading or trailing decimal points in numeric literals
- Disallow leading or trailing decimal points in numeric literals See rule details.
- org.openrewrite.codemods.format.NoMultiSpaces
- Disallow multiple spaces
- Disallow multiple spaces See rule details.
- org.openrewrite.codemods.format.NoMultipleEmptyLines
- Disallow multiple empty lines
- Disallow multiple empty lines See rule details.
- org.openrewrite.codemods.format.NoTrailingSpaces
- Disallow trailing whitespace at the end of lines
- Disallow trailing whitespace at the end of lines See rule details.
- org.openrewrite.codemods.format.NoWhitespaceBeforeProperty
- Disallow whitespace before properties
- Disallow whitespace before properties See rule details.
- org.openrewrite.codemods.format.NonblockStatementBodyPosition
- Enforce the location of single-line statements
- Enforce the location of single-line statements See rule details.
- org.openrewrite.codemods.format.ObjectCurlyNewline
- Enforce consistent line breaks after opening and before closing braces
- Enforce consistent line breaks after opening and before closing braces See rule details.
- org.openrewrite.codemods.format.ObjectCurlySpacing
- Enforce consistent spacing inside braces
- Enforce consistent spacing inside braces See rule details.
- org.openrewrite.codemods.format.ObjectPropertyNewline
- Enforce placing object properties on separate lines
- Enforce placing object properties on separate lines See rule details.
- org.openrewrite.codemods.format.OneVarDeclarationPerLine
- Require or disallow newlines around variable declarations
- Require or disallow newlines around variable declarations See rule details.
- org.openrewrite.codemods.format.OperatorLinebreak
- Enforce consistent linebreak style for operators
- Enforce consistent linebreak style for operators See rule details.
- org.openrewrite.codemods.format.PaddedBlocks
- Require or disallow padding within blocks
- Require or disallow padding within blocks See rule details.
- org.openrewrite.codemods.format.PaddingLineBetweenStatements
- Require or disallow padding lines between statements
- Require or disallow padding lines between statements See rule details.
- org.openrewrite.codemods.format.QuoteProps
- Require quotes around object literal property names
- Require quotes around object literal property names See rule details.
- org.openrewrite.codemods.format.Quotes
- Enforce the consistent use of either backticks, double, or single quotes
- Enforce the consistent use of either backticks, double, or single quotes See rule details.
- org.openrewrite.codemods.format.RecommendedESLintStyling
- Recommended ESLint Styling
- Collection of stylistic ESLint rules that are recommended by the ESLint Style..
- org.openrewrite.codemods.format.RestSpreadSpacing
- Enforce spacing between rest and spread operators and their expressions
- Enforce spacing between rest and spread operators and their expressions See rule details.
- org.openrewrite.codemods.format.Semi
- Require or disallow semicolons instead of ASI
- Require or disallow semicolons instead of ASI See rule details.
- org.openrewrite.codemods.format.SemiSpacing
- Enforce consistent spacing before and after semicolons
- Enforce consistent spacing before and after semicolons See rule details.
- org.openrewrite.codemods.format.SemiStyle
- Enforce location of semicolons
- Enforce location of semicolons See rule details.
- org.openrewrite.codemods.format.SpaceBeforeBlocks
- Enforce consistent spacing before blocks
- Enforce consistent spacing before blocks See rule details.
- org.openrewrite.codemods.format.SpaceBeforeFunctionParen
- Enforce consistent spacing before `function` definition opening parenthesis
- Enforce consistent spacing before `function` definition opening parenthesis See rule details.
- org.openrewrite.codemods.format.SpaceInParens
- Enforce consistent spacing inside parentheses
- Enforce consistent spacing inside parentheses See rule details.
- org.openrewrite.codemods.format.SpaceInfixOps
- Require spacing around infix operators
- Require spacing around infix operators See rule details.
- org.openrewrite.codemods.format.SpaceUnaryOps
- Enforce consistent spacing before or after unary operators
- Enforce consistent spacing before or after unary operators See rule details.
- org.openrewrite.codemods.format.SpacedComment
- Enforce consistent spacing after the `//` or `/*` in a comment
- Enforce consistent spacing after the `//` or `/*` in a comment See rule details.
- org.openrewrite.codemods.format.SwitchColonSpacing
- Enforce spacing around colons of switch statements
- Enforce spacing around colons of switch statements See rule details.
- org.openrewrite.codemods.format.TemplateCurlySpacing
- Require or disallow spacing around embedded expressions of template strings
- Require or disallow spacing around embedded expressions of template strings See rule details.
- org.openrewrite.codemods.format.TemplateTagSpacing
- Require or disallow spacing between template tags and their literals
- Require or disallow spacing between template tags and their literals See rule details.
- org.openrewrite.codemods.format.TypeAnnotationSpacing
- Require consistent spacing around type annotations
- Require consistent spacing around type annotations See rule details.
- org.openrewrite.codemods.format.TypeGenericSpacing
- Enforces consistent spacing inside TypeScript type generics
- Enforces consistent spacing inside TypeScript type generics See rule details.
- org.openrewrite.codemods.format.TypeNamedTupleSpacing
- Expect space before the type declaration in the named tuple
- Expect space before the type declaration in the named tuple See rule details.
- org.openrewrite.codemods.format.WrapIife
- Require parentheses around immediate `function` invocations
- Require parentheses around immediate `function` invocations See rule details.
- org.openrewrite.codemods.format.WrapRegex
- Require parenthesis around regex literals
- Require parenthesis around regex literals See rule details.
- org.openrewrite.codemods.format.YieldStarSpacing
- Require or disallow spacing around the `` in `yield` expressions
- Require or disallow spacing around the `` in `yield` expressions See rule details.
- org.openrewrite.codemods.migrate.angular.v15
- Update to Angular v15
- Upgrade to Angular v15 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v16
- Update to Angular v16
- Upgrade to Angular v16 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v17
- Update to Angular v17
- Upgrade to Angular v17 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v18
- Update to Angular v18
- Upgrade to Angular v18 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v19
- Update to Angular v19
- Upgrade to Angular v19 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v20
- Update to Angular v20
- Upgrade to Angular v20 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v21
- Update to Angular v21
- Upgrade to Angular v21 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreArray
- Replace lodash and underscore array functions with native JavaScript
-
_.head(x)->x[0]-_.head(x, n)->x.slice(n)-_.first(alias for_.head) -_.tail(x)->x.slice(1)-_.tail(x, n)->x.slice(n)-_.rest(alias for_.tail) -_.last(x)->x[x.length - 1]-_.last(x, n)->x.slice(x.length - n).
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreFunction
- Replace lodash and underscore function functions with native JavaScript
-
_.bind(fn, obj, ...x)->fn.bind(obj, ...x)-_.partial(fn, a, b);->(...args) => fn(a, b, ...args).
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreObjects
- Replace lodash and underscore object functions with native JavaScript
-
_.clone(x)->{ ...x }-_.extend({}, x, y)->{ ...x, ...y }-_.extend(obj, x, y)->Object.assign(obj, x, y)-_.keys(x)->Object.keys(x)-_.pairs(x)->Object.entries(x)-_.values(x)->Object.values(x).
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreUtil
- Replace lodash and underscore utility functions with native JavaScript
-
_.isArray(x)->Array.isArray(x)-_.isBoolean(x)->typeof(x) === 'boolean'-_.isFinite(x)->Number.isFinite(x)-_.isFunction(x)->typeof(x) === 'function'-_.isNull(x)->x === null-_.isString(x)->typeof(x) === 'string'-_.isUndefined(x)->typeof(x) === 'undefined'.
- org.openrewrite.codemods.migrate.mui.AdapterV
- Converts components to use the v4 adapter module
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.All
- Combination of all deprecations
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.AutocompleteRenameCloseicon
- Renames
closeIconprop tocloseButtonIcon - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.AutocompleteRenameOption
- Renames
optionprop togetOptionLabel - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.AvatarCircleCircular
- Updates
circleprop tovariant="circular" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BadgeOverlapValue
- Updates
overlapprop tovariant="dot" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BaseHookImports
- Converts base imports to use React hooks
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BaseRemoveComponentProp
- Removes
componentprop from base components - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.BaseRemoveUnstyledSuffix
- Removes
Unstyledsuffix from base components - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.BaseRenameComponentsToSlots
- Renames base components to slots
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BaseUseNamedExports
- Updates base imports to use named exports
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BoxBorderradiusValues
- Updates
borderRadiusprop values - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BoxRenameCss
- Renames CSS properties for Box component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BoxRenameGap
- Renames
gapprop tospacing - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.BoxSxProp
- Converts
sxprop tosxstyle prop - See Material UI codemod projects for more details.
- Converts
- org.openrewrite.codemods.migrate.mui.ButtonColorProp
- Renames
colorprop tocolorOverride - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.ChipVariantProp
- Updates
variantprop for Chip component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.CircularprogressVariant
- Updates
variantprop for CircularProgress component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.CollapseRenameCollapsedheight
- Renames
collapsedHeightprop totransitionCollapsedHeight - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.ComponentRenameProp
- Renames
componentprop toas - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.CoreStylesImport
- Updates import paths for core styles
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.CreateTheme
- Updates createMuiTheme usage
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.DatePickersMovedToX
- Moves date pickers to
@mui/x-date-picker - See Material UI codemod projects for more details.
- Moves date pickers to
- org.openrewrite.codemods.migrate.mui.DialogProps
- Updates props for Dialog component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.DialogTitleProps
- Updates props for DialogTitle component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.EmotionPrependCache
- Prepends emotion cache
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ExpansionPanelComponent
- Converts ExpansionPanel to use ExpansionPanel component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.FabVariant
- Updates
variantprop for Fab component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.FadeRenameAlpha
- Renames
alphaprop toopacity - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.GridJustifyJustifycontent
- Updates
justifyprop tojustifyContentfor Grid component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.GridListComponent
- Converts GridList to use Grid component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.GridVProps
- Updates the usage of the
@mui/material/Grid2,@mui/system/Grid, and@mui/joy/Gridcomponents to their updated APIs - See Material UI codemod projects for more details.
- Updates the usage of the
- org.openrewrite.codemods.migrate.mui.HiddenDownProps
- Updates
downprop for Hidden component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.IconButtonSize
- Updates
sizeprop for IconButton component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.JoyAvatarRemoveImgprops
- Removes
imgPropsprop from Avatar component - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.JoyRenameClassnamePrefix
- Renames
Muiclassname prefix - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JoyRenameComponentsToSlots
- Renames components to slots
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.JoyRenameRowProp
- Renames
rowprop toflexDirection="row" - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JoyTextFieldToInput
- Renames
TextFieldtoInput - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JssToStyled
- Converts JSS styles to styled-components
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.JssToTssReact
- Converts JSS to TypeScript in React components
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.LinkUnderlineHover
- Updates link underline on hover
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.MaterialUiStyles
- Updates usage of
@mui/styles - See Material UI codemod projects for more details.
- Updates usage of
- org.openrewrite.codemods.migrate.mui.MaterialUiTypes
- Updates usage of
@mui/types - See Material UI codemod projects for more details.
- Updates usage of
- org.openrewrite.codemods.migrate.mui.ModalProps
- Updates props for Modal component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.MovedLabModules
- Moves lab modules to
@mui/material - See Material UI codemod projects for more details.
- Moves lab modules to
- org.openrewrite.codemods.migrate.mui.MuiReplace
- Replaces
@muiimports with@mui/material - See Material UI codemod projects for more details.
- Replaces
- org.openrewrite.codemods.migrate.mui.OptimalImports
- Optimizes imports
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.PaginationRoundCircular
- Updates
circularprop tovariant="circular" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.PresetSafe
- Ensures presets are safe to use
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.RenameCssVariables
- Renames CSS variables
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.RootRef
- Converts
rootReftoref - See Material UI codemod projects for more details.
- Converts
- org.openrewrite.codemods.migrate.mui.SkeletonVariant
- Updates
variantprop for Skeleton component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.Styled
- Updates the usage of
styledfrom@mui/system@v5to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Updates the usage of
- org.openrewrite.codemods.migrate.mui.StyledEngineProvider
- Updates usage of styled engine provider
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.SxProp
- Update the usage of the
sxprop to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Update the usage of the
- org.openrewrite.codemods.migrate.mui.SystemProps
- Remove system props and add them to the
sxprop - See Material UI codemod projects for more details.
- Remove system props and add them to the
- org.openrewrite.codemods.migrate.mui.TableProps
- Updates props for Table component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TabsScrollButtons
- Updates scroll buttons for Tabs component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TextareaMinmaxRows
- Updates
minRowsandmaxRowsprops for TextareaAutosize component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeAugment
- Adds
DefaultThememodule augmentation to typescript projects - See Material UI codemod projects for more details.
- Adds
- org.openrewrite.codemods.migrate.mui.ThemeBreakpoints
- Updates theme breakpoints
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeBreakpointsWidth
- Updates
widthvalues for theme breakpoints - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeOptions
- Updates theme options
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemePaletteMode
- Updates theme palette mode
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeProvider
- Updates usage of ThemeProvider
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeSpacing
- Updates theme spacing
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeSpacingApi
- Updates theme spacing API
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeTypographyRound
- Updates
roundvalues for theme typography - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeV
- Update the theme creation from
@mui/system@v5to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Update the theme creation from
- org.openrewrite.codemods.migrate.mui.TopLevelImports
- Converts all
@mui/materialsubmodule imports to the root module - See Material UI codemod projects for more details.
- Converts all
- org.openrewrite.codemods.migrate.mui.Transitions
- Updates usage of transitions
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TreeViewMovedToX
- Moves tree view to
@mui/x-tree-view - See Material UI codemod projects for more details.
- Moves tree view to
- org.openrewrite.codemods.migrate.mui.UseAutocomplete
- Updates usage of useAutocomplete
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.UseTransitionprops
- Updates usage of useTransitionProps
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.VariantProp
- Updates
variantprop usage - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.WithMobileDialog
- Updates withMobileDialog higher-order component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.WithWidth
- Updates withWidth higher-order component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.nextjs.NextJsCodemods
- Next.js Codemods for API Updates
- Next.js provides Codemod transformations to help upgrade your Next.js codebase when an API is updated or deprecated.
- org.openrewrite.concourse.search.FindPrivilegedResourceType
- Find privileged
resource_typedefinitions - By default,
resource_typedefinitions are unprivileged.
- Find privileged
- org.openrewrite.cucumber.jvm.UpgradeCucumber7x
- Upgrade to Cucumber-JVM 7.x
- Upgrade to Cucumber-JVM 7.x from any previous version.
- org.openrewrite.dotnet.MigrateToNet6
- Upgrade to .NET 6.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 6.0.
- org.openrewrite.dotnet.MigrateToNet7
- Upgrade to .NET 7.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 7.0.
- org.openrewrite.dotnet.MigrateToNet8
- Upgrade to .NET 8.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 8.0.
- org.openrewrite.dotnet.MigrateToNet9
- Upgrade to .NET 9.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 9.0.
- org.openrewrite.featureflags.launchdarkly.UpgradeLaunchDarkly7
- Migrate to LaunchDarkly 7.x
- This recipe will apply changes commonly needed when migrating to LaunchDarkly 7.x.
- org.openrewrite.github.AddManualTrigger
- Add manual workflow trigger
- You can manually trigger workflow runs. To trigger specific workflows in a repository, use the
workflow_dispatchevent.
- org.openrewrite.github.DependabotCheckForGithubActionsUpdatesDaily
- Check for github-actions updates daily
- Set dependabot to check for github-actions updates daily.
- org.openrewrite.github.DependabotCheckForGithubActionsUpdatesWeekly
- Check for github-actions updates weekly
- Set dependabot to check for github-actions updates weekly.
- org.openrewrite.github.FindGitHubActionSecretReferences
- Find GitHub action secret references
- Help identify and inventory your GitHub secrets that are being used in GitHub actions.
- org.openrewrite.github.MigrateSetupUvV6ToV7
- Migrate
astral-sh/setup-uvfrom v6 to v7 - Migrates
astral-sh/setup-uvfrom v6 to v7. Updates the action version and removes the deprecatedserver-urlinput. See the v7.0.0 release notes for breaking changes.
- Migrate
- org.openrewrite.github.MigrateTibdexGitHubAppTokenToActions
- Migrate from tibdex/github-app-token to actions/create-github-app-token
- Migrates from tibdex/github-app-token@v2 to actions/create-github-app-token@v2 and updates parameter names from snake_case to kebab-case.
- org.openrewrite.github.ReplaceOssrhSecretsWithSonatype
- Replace OSSRH secrets with Sonatype secrets
- Replace deprecated OSSRH_S01 secrets with new Sonatype secrets in GitHub Actions workflows. This is an example use of the
ReplaceSecretsandReplaceSecretKeysrecipes combined used to update the Maven publishing secrets in OpenRewrite's GitHub organization.
- org.openrewrite.github.gradle.RenameGradleBuildActionToSetupGradle
- Rename
gradle/gradle-build-actiontogradle/actions/setup-gradle - Rename the deprecated
gradle/gradle-build-actiontogradle/actions/setup-gradle@v3.
- Rename
- org.openrewrite.github.gradle.RenameWrapperValidationAction
- Rename
gradle/wrapper-validation-actiontogradle/actions/wrapper-validation - Rename the deprecated
gradle/wrapper-validation-actiontogradle/actions/wrapper-validation@v3.
- Rename
- org.openrewrite.github.security.GitHubActionsSecurity
- GitHub Actions security insights
- Finds potential security issues in GitHub Actions workflows, based on Zizmor security analysis rules.
- org.openrewrite.gradle.GradleBestPractices
- Apply Gradle best practices
- Apply a set of Gradle best practices to the build files, for more efficient and ideomatic builds.
- org.openrewrite.gradle.plugins.RemoveDevelocity
- Remove Develocity
- Remove the Develocity plugin and configuration from the Gradle build and settings files.
- org.openrewrite.hibernate.validator.HibernateValidator_8_0
- Migrate to Hibernate Validator 8.0.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate Validator 8.0.x.
- org.openrewrite.java.AddApache2LicenseHeader
- Add ASLv2 license header
- Adds the Apache Software License Version 2.0 to Java source files which are missing a license header.
- org.openrewrite.java.dropwizard.MigrateDropwizardToSpringBoot
- Migrate Dropwizard to Spring Boot
- Apply various changes to migrate Dropwizard applications to Spring Boot.
- org.openrewrite.java.dropwizard.MigrateTasksAndCommands
- Migrate
PostBodyTaskandConfiguredCommand - Remove or change the superclasses of
PostBodyTaskandConfiguredCommand.
- Migrate
- org.openrewrite.java.dropwizard.ModifyDropwizardHealthChecksToSpringVariants
- Convert Health Check Implementations
- Transforms Dropwizard HealthCheck classes to Spring Boot HealthIndicator.
- org.openrewrite.java.jackson.CodehausToFasterXML
- Migrate from Jackson Codehaus (legacy) to Jackson FasterXML
- In Jackson 2, the package and dependency coordinates moved from Codehaus to FasterXML.
- org.openrewrite.java.jackson.JacksonBestPractices
- Jackson best practices
- Apply best practices for using Jackson library, including upgrade to Jackson 2.x and removing redundant annotations.
- org.openrewrite.java.joda.time.NoJodaTime
- Prefer the Java standard library instead of Joda-Time
- Before Java 8, Java lacked a robust date and time library, leading to the widespread use of Joda-Time to fill this gap. With the release of Java 8, the
java.timepackage was introduced, incorporating most of Joda-Time's concepts. Features deemed too specialized or bulky forjava.timewere included in the ThreeTen-Extra library. This recipe migrates Joda-Time types tojava.timeandthreeten-extratypes.
- org.openrewrite.java.jspecify.JSpecifyBestPractices
- JSpecify best practices
- Apply JSpecify best practices, such as migrating off of alternatives, and adding missing
@Nullableannotations.
- org.openrewrite.java.liberty.MigrateFromWebSphereToLiberty
- Migrate from WebSphere traditional to Liberty
- Use this category of rules to identify code changes needed when migrating from WebSphere Application Server traditional to Liberty.
- org.openrewrite.java.logging.log4j.CommonsLoggingToLog4j
- Migrate JCL to Log4j 2.x API
- Transforms code written using Apache Commons Logging to use Log4j 2.x API.
- org.openrewrite.java.logging.log4j.Slf4jToLog4j
- Migrate SLF4J to Log4j 2.x API
- Transforms code written using SLF4J to use Log4j 2.x API.
- org.openrewrite.java.logging.logback.Log4jToLogback
- Migrate Log4j 2.x to Logback
- Migrates usage of Apache Log4j 2.x to using
logbackas an SLF4J implementation directly. Note, this currently does not modifylog4j.propertiesfiles.
- org.openrewrite.java.logging.slf4j.CommonsLogging1ToSlf4j1
- Migrate Apache Commons Logging 1.x to SLF4J 1.x
- Transforms usages of Apache Commons Logging 1.x to leveraging SLF4J 1.x directly.
- org.openrewrite.java.logging.slf4j.JBossLoggingToSlf4j
- Migrate JBoss Logging to SLF4J
- Migrates usage of the JBoss Logging facade to using SLF4J.
- org.openrewrite.java.logging.slf4j.JulToSlf4j
- Migrate JUL to SLF4J
- Migrates usage of Java Util Logging (JUL) to using SLF4J directly.
- org.openrewrite.java.logging.slf4j.Slf4jBestPractices
- SLF4J best practices
- Applies best practices to logging with SLF4J.
- org.openrewrite.java.micronaut.Micronaut2to3Migration
- Migrate from Micronaut 2.x to 3.x
- This recipe will apply changes required for migrating from Micronaut 2 to Micronaut 3.
- org.openrewrite.java.micronaut.Micronaut3to4Migration
- Migrate from Micronaut 3.x to 4.x
- This recipe will apply changes required for migrating from Micronaut 3 to Micronaut 4.
- org.openrewrite.java.micronaut.UpdateBlockingTaskExecutors
- Migrate the use of TaskExecutors with blocking IO
- This recipe will any usage of TaskExecutors.IO to TaskExecutors.BLOCKING in order to be compatible with virtual threads.
- org.openrewrite.java.migrate.ComIntelliJAnnotationsToOrgJetbrainsAnnotations
- Migrate com.intellij:annotations to org.jetbrains:annotations
- This recipe will upgrade old dependency of com.intellij:annotations to the newer org.jetbrains:annotations.
- org.openrewrite.java.migrate.IBMJDKtoOracleJDK
- Migrate from IBM Runtimes to Oracle Runtimes
- This recipe will apply changes commonly needed when upgrading Java versions. The solutions provided in this list are solutions necessary for migrating from IBM Runtimes to Oracle Runtimes.
- org.openrewrite.java.migrate.IBMSemeru
- Migrate to IBM Semeru Runtimes
- This recipe will apply changes commonly needed when upgrading Java versions. The solutions provided in this list are solutions only available in IBM Semeru Runtimes.
- org.openrewrite.java.migrate.UpgradeToJava25
- Migrate to Java 25
- This recipe will apply changes commonly needed when migrating to Java 25. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 25 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 25.
- org.openrewrite.java.migrate.WasDevMvnChangeParentArtifactId
- Change
net.wasdev.maven.parent:java8-parentto:parent - This recipe changes the artifactId of the
<parent>tag in thepom.xmlfromjava8-parenttoparent.
- Change
- org.openrewrite.java.migrate.guava.NoGuava
- Prefer the Java standard library instead of Guava
- Guava filled in important gaps in the Java standard library and still does. But at least some of Guava's API surface area is covered by the Java standard library now, and some projects may be able to remove Guava altogether if they migrate to standard library for these functions.
- org.openrewrite.java.migrate.guava.PreferIntegerRemainderUnsigned
- Prefer
Integer#remainderUnsigned - Prefer
java.lang.Integer#remainderUnsignedinstead of usingcom.google.common.primitives.UnsignedInts#remainderUnsigned.
- Prefer
- org.openrewrite.java.migrate.jakarta.UpdateJakartaAnnotations2
- Update Jakarta EE annotation Dependencies to 2.1.x
- Update Jakarta EE annotation Dependencies to 2.1.x.
- org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithoutRuntime
- Add explicit JAXB API dependencies and remove runtimes
- This recipe will add explicit API dependencies without runtime dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing API dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the
javax.xml.bindnamespace. All JAXB runtime implementation dependencies are removed.
- org.openrewrite.java.migrate.javax.openJPAToEclipseLink
- Migrate from OpenJPA to EclipseLink JPA
- These recipes help migrate Java Persistence applications using OpenJPA to EclipseLink JPA.
- org.openrewrite.java.migrate.lang.FindVirtualThreadOpportunities
- Find Virtual Thread opportunities
- Find opportunities to convert existing code to use Virtual Threads.
- org.openrewrite.java.migrate.lang.UseVar
- Use local variable type inference
- Apply local variable type inference (
var) for primitives and objects. These recipes can cause unused imports, be advised to run `org.openrewrite.java.RemoveUnusedImports afterwards.
- org.openrewrite.java.migrate.lombok.LombokBestPractices
- Lombok Best Practices
- Applies all recipes that enforce best practices for using Lombok.
- org.openrewrite.java.migrate.util.JavaUtilAPIs
- Use modernized
java.utilAPIs - Certain java util APIs have been introduced and are favored over previous APIs.
- Use modernized
- org.openrewrite.java.search.FindSecrets
- Find plain text secrets
- Find secrets stored in plain text in code.
- org.openrewrite.java.security.JavaSecurityBestPractices
- Java security best practices
- Applies security best practices to Java code.
- org.openrewrite.java.security.OwaspTopTen
- Remediate vulnerabilities from the OWASP Top Ten
- OWASP publishes a list of the most impactful common security vulnerabilities. These recipes identify and remediate vulnerabilities from the OWASP Top Ten.
- org.openrewrite.java.security.secrets.FindSecrets
- Find secrets
- Locates secrets stored in plain text in code.
- org.openrewrite.java.spring.boot2.search.FindUpgradeRequirementsSpringBoot_2_5
- Find patterns that require updating for Spring Boot 2.5
- Looks for a series of patterns that have not yet had auto-remediation recipes developed for.
- org.openrewrite.java.spring.boot3.SpringBoot33BestPractices
- Spring Boot 3.3 best practices
- Applies best practices to Spring Boot 3 applications.
- org.openrewrite.java.spring.http.SpringWebDependency
- Find Spring Web dependency
- Find compile scoped Spring Web dependency for Maven and Gradle, both direct and transitive.
- org.openrewrite.java.spring.opentelemetry.MigrateToOpenTelemetry
- Complete migration to OpenTelemetry
- Comprehensive migration to OpenTelemetry including dependencies, configuration properties, and Java code changes. This recipe handles migration from Spring Cloud Sleuth, Brave/Zipkin, and OpenTracing to OpenTelemetry.
- org.openrewrite.java.struts.migrate6.MigrateStruts6
- Migrate to Struts 6.0
- Migrate Struts 2.x to Struts 6.0.
- org.openrewrite.java.testing.archunit.ArchUnit0to1Migration
- ArchUnit 0.x upgrade
- Upgrade ArchUnit from 0.x to 1.x.
- org.openrewrite.java.testing.assertj.Assertj
- AssertJ best practices
- Migrates JUnit asserts to AssertJ and applies best practices to assertions.
- org.openrewrite.java.testing.cleanup.BestPractices
- Testing best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.datafaker.JavaFakerToDataFaker
- Migrate from Java Faker to Datafaker
- Change imports and dependencies related to Java Faker to Datafaker replacements.
- org.openrewrite.java.testing.easymock.EasyMockToMockito
- Migrate from EasyMock to Mockito
- This recipe will apply changes commonly needed when migrating from EasyMock to Mockito.
- org.openrewrite.java.testing.jmockit.JMockitToMockito
- Migrate from JMockit to Mockito
- This recipe will apply changes commonly needed when migrating from JMockit to Mockito.
- org.openrewrite.java.testing.junit.JUnit6BestPractices
- JUnit 6 best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.testcontainers.TestContainersBestPractices
- Testcontainers best practices
- Apply best practices to Testcontainers usage.
- org.openrewrite.javascript.change-import
- Change import
- Changes an import from one module/member to another, updating all type attributions.
- org.openrewrite.javascript.cleanup.add-parse-int-radix
- Add radix to
parseInt - Adds the radix parameter (base 10) to
parseInt()calls that are missing it, preventing potential parsing issues.
- Add radix to
- org.openrewrite.javascript.cleanup.async-callback-in-sync-array-method
- Detect async callbacks in synchronous array methods
- Detects async callbacks passed to array methods like .some(), .every(), .filter() which don't await promises. This is a common bug where Promise objects are always truthy.
- org.openrewrite.javascript.cleanup.order-imports
- Order imports
- Sort imports by category and module path. Categories: side-effect, namespace, default, named, type. Within each category, imports are sorted alphabetically by module path. Named specifiers within each import are also sorted alphabetically.
- org.openrewrite.javascript.cleanup.prefer-optional-chain
- Prefer optional chaining
- Converts ternary expressions like
foo ? foo.bar : undefinedto use optional chaining syntaxfoo?.bar.
- org.openrewrite.javascript.cleanup.use-object-property-shorthand
- Use object property shorthand
- Simplifies object properties where the property name and value/variable name are the same (e.g.,
{ x: x }becomes{ x }). Applies to both destructuring patterns and object literals.
- org.openrewrite.javascript.dependencies.add-dependency
- Add npm dependency
- Adds a new dependency to
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.dependencies.find-dependency
- Find Node.js dependency
- Finds dependencies in a project's
package.json. Can find both direct dependencies and dependencies that transitively include the target package. This recipe is commonly used as a precondition for other recipes.
- org.openrewrite.javascript.dependencies.upgrade-dependency-version
- Upgrade npm dependency version
- Upgrades the version of a direct dependency in
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.dependencies.upgrade-transitive-dependency-version
- Upgrade transitive npm dependency version
- Upgrades the version of a transitive dependency by adding override/resolution entries to
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.format.auto-format
- Auto-format JavaScript/TypeScript code
- Format JavaScript and TypeScript code using formatting rules auto-detected from the project's existing code style.
- org.openrewrite.javascript.migrate.es6.modernize-octal-escape-sequences
- Modernize octal escape sequences
- Convert old-style octal escape sequences (e.g.,
\0,\123) to modern hex escape sequences (e.g.,\x00,\x53) or Unicode escape sequences (e.g.,\u0000,\u0053).
- org.openrewrite.javascript.migrate.es6.modernize-octal-literals
- Modernize octal literals
- Convert old-style octal literals (e.g.,
0777) to modern ES6 syntax (e.g.,0o777).
- org.openrewrite.javascript.migrate.es6.remove-duplicate-object-keys
- Remove duplicate object keys
- Remove duplicate keys in object literals, keeping only the last occurrence (last-wins semantics).
- org.openrewrite.javascript.migrate.typescript.export-assignment-to-export-default
- Convert
export =toexport default - Converts TypeScript
export =syntax to ES moduleexport defaultsyntax for compatibility with ECMAScript modules.
- Convert
- org.openrewrite.jenkins.CommonsLang3ToApiPlugin
- Use commons-lang3 API Plugin
- Updates
pom.xmlto depend oncommons-lang3-apiand excludecommons-lang3where it is brought in transitively.
- org.openrewrite.jenkins.CreateJenkinsfile
- Create Jenkinsfile
- Creates a simple base Jenkinsfile in Groovy for a Declarative Pipeline - located in the root of the project.
- org.openrewrite.jenkins.JavaxAnnotationsToSpotbugs
- Migrate
javax.annotationsto SpotBugs annotations - SpotBugs is the preferred replacement of JSR-305 annotations for Jenkins plugins.
- Migrate
- org.openrewrite.jenkins.ModernizeJenkinsfile
- Modernize Jenkinsfile
- Updates
Jenkinsfileto build with recommended Java versions, platforms, and settings.
- org.openrewrite.jenkins.ModernizePlugin
- Modernize a Jenkins plugin to the latest recommended versions
- This recipe is intended to change over time to reflect the recommended tooling and recommended Jenkins baseline.
- org.openrewrite.jenkins.ModernizePluginForJava8
- Modernize a Jenkins plugin to the latest versions supported by Java 8
- This recipe is intended to break down the modernization of very old plugins into distinct steps. It allows modernizing all tooling up to the last versions that supported Java 8. This can then be followed by another recipe that makes the jump to Java 11.
- org.openrewrite.jenkins.migrate.hudson.UtilGetPastTimeStringToGetTimeSpanString
- Replace
hudson.Util.getPastTimeStringwithgetTimeSpanString hudson.Util.getPastTimeStringhas been deprecated since the 2.204.1 LTS release on 2019-12-18.
- Replace
- org.openrewrite.kubernetes.KubernetesBestPractices
- Kubernetes best practices
- Applies best practices to Kubernetes manifests.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_35
- Migrate to Kubernetes API v1.35
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.35.
- org.openrewrite.kubernetes.search.FindHarcodedIPAddresses
- Find hardcoded IP addresses
- Find hardcoded IP address anywhere in text-based files.
- org.openrewrite.maven.MigrateToMaven4
- Migrate to Maven 4
- Migrates Maven POMs from Maven 3 to Maven 4, addressing breaking changes and deprecations. This recipe updates property expressions, lifecycle phases, removes duplicate plugin declarations, and replaces removed properties to ensure compatibility with Maven 4.
- org.openrewrite.micrometer.MicrometerBestPractices
- Micrometer best practices
- This recipe will apply a set of best practice refactorings for Micrometer, like adopting
Observationsinstead ofTimers.
- org.openrewrite.micrometer.misk.MigrateMiskToMicrometer
- Migrate Misk metrics to Micrometer
- This recipe will move Misk metrics to Micrometer, where that is possible to do without a loss of fidelity.
- org.openrewrite.netty.UpgradeNetty_4_1_to_4_2
- Migrates from Netty 4.1.x to Netty 4.2.x
- Migrate applications to the latest Netty 4.2.x release.
- org.openrewrite.nodejs.search.DatabaseInteractionInsights
- Javascript database interaction library insights
- Discover which popular javascript database interaction libraries (Sequelize, TypeORM, Mongoose, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.FormHandlingInsights
- Javascript form handling library insights
- Discover which popular javascript form handling libraries (Formik, React Hook Form, Yup, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.LintingFormattingInsights
- Javascript linting & formatting library insights
- Discover which popular javascript linting and formatting libraries (ESLint, Prettier, Stylelint, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.RealTimeCommunicationInsights
- Javascript real-time communication library insights
- Discover which popular javascript real-time communication libraries (Socket.io, Ws, SockJS, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.SecurityInsights
- Javascript security library insights
- Discover which popular javascript security libraries (Helmet, Cors, Bcrypt, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.ServerSideFrameworksInsights
- Javascript server-side frameworks insights
- Discover which popular javascript server-side frameworks (Express, Koa, Hapi, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.StateManagementInsights
- Javascript state management library insights
- Discover which popular javascript state management libraries (Redux, MobX, Vuex, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.TaskRunnersBuildToolsInsights
- Javascript task runners & build tools insights
- Discover which popular javascript task runners and build tools (Webpack, Parcel, Gulp, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.TestingInsights
- Javascript testing library insights
- Discover which popular javascript testing libraries (Jest, Mocha, Chai, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.UIInsights
- Javascript UI library insights
- Discover which popular javascript UI libraries (React, Vue.js, Angular, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.UtilityInsights
- Javascript utility library insights
- Discover which popular javascript utility libraries (Lodash, Moment.js, Date-fns, etc.) are being used in your projects.
- org.openrewrite.okhttp.UpgradeMockWebServer3
- Migrate to MockWebServer3 (core module)
- Migrate from the legacy
mockwebserverartifact tomockwebserver3core module without JUnit dependency.
- org.openrewrite.okhttp.UpgradeMockWebServer3JUnit4
- Migrate to MockWebServer3 with JUnit 4
- Migrate from the legacy
mockwebserverartifact tomockwebserver3-junit4with JUnit 4 integration.
- org.openrewrite.okhttp.UpgradeOkHttp5
- Migrate to OkHttp 5.x
- This recipe will apply changes commonly needed when migrating to OkHttp 5.x.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_31_0
- Quarkus Updates Aggregate 3.31.0
- Quarkus update recipes to upgrade your application to 3.31.0.
- org.openrewrite.quarkus.migrate.javaee.JavaEEtoQuarkus2Migration
- Migrate JavaEE to Quarkus 2
- These recipes help with the migration of a JavaEE application using EJBs and Hibernate to Quarkus 2. Additional transformations like JSF, JMS, Quarkus Tests may be necessary.
- org.openrewrite.quarkus.spring.SpringBootToQuarkus
- Migrate Spring Boot to Quarkus
- Replace Spring Boot with Quarkus.
- org.openrewrite.reactive.reactor.ReactorBestPractices
- Reactor Best Practices
- This recipe applies best practices for using Reactor.
- org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices
- OpenRewrite recipe best practices
- Best practices for OpenRewrite recipe development.
- org.openrewrite.sql.MigrateOracleToPostgres
- Migrate Oracle SQL to PostgreSQL
- Converts Oracle-specific SQL syntax and functions to PostgreSQL equivalents.
- org.openrewrite.sql.MigrateSqlServerToPostgres
- Migrate SQL Server to PostgreSQL
- Converts Microsoft SQL Server-specific SQL syntax and functions to PostgreSQL equivalents.
- org.openrewrite.staticanalysis.CodeCleanup
- Code cleanup
- Automatically cleanup code, e.g. remove unnecessary parentheses, simplify expressions.
- org.openrewrite.staticanalysis.CommonDeclarationSiteTypeVariances
- Properly use declaration-site type variance for well-known types
- When using a method parameter like
Function<IN, OUT>, it should rather beFunction<? super IN, ? extends OUT>. This recipe checks for method parameters of well-known types.
- org.openrewrite.staticanalysis.CommonStaticAnalysis
- Common static analysis issues
- Resolve common static analysis issues (also known as SAST issues).
- org.openrewrite.staticanalysis.JavaApiBestPractices
- Java API best practices
- Use the Java standard library in a way that is most idiomatic.
- org.openrewrite.staticanalysis.ReplaceApacheCommonsLang3ValidateNotNullWithObjectsRequireNonNull
- Replace
org.apache.commons.lang3.Validate#notNullwithObjects#requireNonNull - Replace
org.apache.commons.lang3.Validate.notNull(..)withObjects.requireNonNull(..).
- Replace
- org.openrewrite.tapestry.MigrateTapestry4To5
- Migrate Tapestry 4 to Tapestry 5
- Migrates Apache Tapestry 4 applications to Tapestry 5. This includes package renames, removing base class inheritance, converting listener interfaces to annotations, and updating dependencies.
- org.openrewrite.terraform.aws.AWSBestPractices
- Best practices for AWS
- Securely operate on Amazon Web Services.
- org.openrewrite.terraform.aws.EnsureTheS3BucketHasAccessLoggingEnabled
- Ensure the S3 bucket has access logging enabled
- Ensure the S3 bucket has access logging enabled.
- org.openrewrite.terraform.azure.AzureBestPractices
- Best practices for Azure
- Securely operate on Microsoft Azure.
- org.openrewrite.terraform.azure.EnsureAppServicesUseAzureFiles
- Ensure app services use Azure files
- Ensure app services use Azure files.
- org.openrewrite.terraform.azure.EnsureKeyVaultKeyIsBackedByHSM
- Ensure key vault key is backed by HSM
- Ensure key vault key is backed by HSM.
- org.openrewrite.terraform.azure.EnsureWebAppHasIncomingClientCertificatesEnabled
- Ensure Web App has incoming client certificates enabled
- Ensure Web App has incoming client certificates enabled.
- org.openrewrite.terraform.gcp.GCPBestPractices
- Best practices for GCP
- Securely operate on Google Cloud Platform.
- software.amazon.awssdk.v2migration.AwsSdkJavaV1ToV2
- Migrate from the AWS SDK for Java v1 to the AWS SDK for Java v2
- This recipe will apply changes required for migrating from the AWS SDK for Java v1 to the AWS SDK for Java v2.
- tech.picnic.errorprone.refasterrules.AllRefasterRules
- All Picnic Refaster rules
- Collection of all Refaster rules from Picnic's error-prone-contrib project.
rewrite-ai-search
- io.moderne.ai.FindCommentsLanguage
- Find comments' language distribution
- Finds all comments and uses AI to predict which language the comment is in.
- io.moderne.ai.ListAllMethodsUsed
- List all methods used
- List all methods used in any Java source file.
- io.moderne.ai.research.FindCodeThatResembles
- Find method invocations that resemble a pattern
- This recipe uses two phase AI approach to find a method invocation that resembles a search string.
- io.moderne.ai.research.GetCodeEmbedding
- Get embeddings for code snippets in code
- This recipe calls an AI model to get an embedding for either classes or methods which can then be used for downstream tasks.
- io.moderne.ai.research.GetRecommendations
- Get recommendations
- This recipe calls an AI model to get recommendations for modernizing the code base by looking at a sample of method declarations.
rewrite-all
- org.openrewrite.FindCallGraph
- Find call graph
- Produces a data table where each row represents a method call.
- org.openrewrite.FindDuplicateSourceFiles
- Find duplicate source files
- Record the presence of LSTs with duplicate paths, indicating that the same file was parsed more than once.
- org.openrewrite.LanguageComposition
- Language composition report
- Counts the number of lines of the various kinds of source code and data formats parsed by OpenRewrite. Comments are not included in line counts. This recipe emits its results as two data tables, making no changes to any source file. One data table is per-file, the other is per-repository.
rewrite-analysis
- org.openrewrite.analysis.controlflow.ControlFlowVisualization
- Control flow visualization
- Visualize the control flow of a Java program.
- org.openrewrite.analysis.search.FindFlowBetweenMethods
- Finds flow between two methods
- Takes two patterns for the start/end methods to find flow between.
- org.openrewrite.analysis.search.FindMethods
- Find method usages
- Find method usages by pattern.
- org.openrewrite.analysis.search.UriCreatedWithHttpScheme
- URIs created with an HTTP scheme
- This is a sample recipe demonstrating a simple application of local data flow analysis.
rewrite-angular
- org.openrewrite.angular.search.FindAngularComponent
- Find Angular component
- Locates usages of Angular components across the codebase including template elements and other references. If
componentNameisnull, finds all Angular components.
rewrite-apache
- org.openrewrite.apache.commons.codec.ApacheBase64ToJavaBase64
- Prefer
java.util.Base64 - Prefer the Java standard library's
java.util.Base64over third-party usage of apache'sapache.commons.codec.binary.Base64.
- Prefer
- org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes
ApacheCommonsFileUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.commons.io.ApacheCommonsFileUtils.
- org.openrewrite.apache.commons.io.ApacheFileUtilsToJavaFiles
- Prefer
java.nio.file.Files - Prefer the Java standard library's
java.nio.file.Filesover third-party usage of apache'sapache.commons.io.FileUtils.
- Prefer
- org.openrewrite.apache.commons.io.ApacheIOUtilsUseExplicitCharset
- Use IOUtils method that include their charset encoding
- Use
IOUtilsmethod invocations that include the charset encoding instead of using the deprecated versions that do not include a charset encoding. (e.g. convertsIOUtils.readLines(inputStream)toIOUtils.readLines(inputStream, StandardCharsets.UTF_8).
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes
ApacheCommonsStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.commons.lang.ApacheCommonsStringUtils.
- org.openrewrite.apache.commons.lang.IsNotEmptyToJdk
- Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)
- Replace any
StringUtils#isEmpty(String)and#isNotEmpty(String)withs == null || s.isEmpty()ands != null && !s.isEmpty().
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes
MavenSharedStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.maven.shared.MavenSharedStringUtils.
- org.openrewrite.codehaus.plexus.AbstractLogEnabledToSlf4j
- Migrate from Plexus
AbstractLogEnabledto SLF4J - Introduce a SLF4J
Loggerfield and replace calls togetLogger()with calls to the field.
- Migrate from Plexus
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes
PlexusFileUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.codehaus.plexus.PlexusFileUtils.
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes
PlexusStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.codehaus.plexus.PlexusStringUtils.
rewrite-azul
- io.moderne.azul.EliminateUnusedClasses
- Eliminate unused classes
- Deprecate and later delete classes that are unused, as detected by Azul Intelligence Cloud.
- io.moderne.azul.search.FindReachableMethods
- Find reachable methods
- Find all methods defined in the repository's source code that are reachable.
rewrite-circleci
- org.openrewrite.circleci.InstallOrb
- Install an orb
- Install a CircleCI orb if it is not already installed.
- org.openrewrite.circleci.UpdateImage
- Update CircleCI image
- See the list of pre-built CircleCI images.
rewrite-codemods
- org.openrewrite.codemods.Biome
- Biome recommendations
- Run Biome recommended settings on your projects.
- org.openrewrite.codemods.Putout
- Run Putout
- Run Putout on your projects.
- org.openrewrite.codemods.ReactI18Next
- React i18next internationalization
- Automatically internationalizes React applications by extracting hardcoded strings and replacing them with react-i18next translation calls. Handles JSX text, attributes, and template literals with variables. Creates and updates a translation JSON file with extracted strings.
- org.openrewrite.codemods.UI5
- Lint UI5 projects with UI5 linter
- Runs the UI5 Linter, a static code analysis tool for UI5 projects. It checks JavaScript, TypeScript, XML, JSON, and other files in your project and reports findings.
rewrite-compiled-analysis
- io.moderne.compiled.verification.ChangeListMethodAndVerify
- Change
List#addtoList#plusand verify - We know this won't compile.
- Change
rewrite-concourse
- org.openrewrite.concourse.ChangeResourceVersion
- Change resource version
- Pin or unpin a resource to a particular version.
- org.openrewrite.concourse.FindResource
- Find resource
- Find a Concourse resource by name.
- org.openrewrite.concourse.UpdateGitResourceUri
- Update git resource
source.urireferences - Update git resource
source.uriURI values to point to a new URI value.
- Update git resource
- org.openrewrite.concourse.search.FindPinnedResource
- Find pinned resources by type
- Find resources of a particular type that have pinned versions.
rewrite-core
- org.openrewrite.AddToGitignore
- Add entries to
.gitignore - Adds entries to the project's
.gitignorefile. If no.gitignorefile exists, one will be created. Existing entries that match will not be duplicated.
- Add entries to
- org.openrewrite.DeleteSourceFiles
- Delete files
- Delete files by source path.
- org.openrewrite.ExcludeFileFromGitignore
- Remove ignoral of files or directories from .gitignore
- This recipe will remove a file or directory from the .gitignore file. If the file or directory is already in the .gitignore file, it will be removed or negated. If the file or directory is not in the .gitignore file, no action will be taken.
- org.openrewrite.FindCollidingSourceFiles
- Find colliding source files
- Finds source files which share a path with another source file. There should always be exactly one source file per path within a repository. This is a diagnostic for finding problems in OpenRewrite parsers/build plugins.
- org.openrewrite.FindDeserializationErrors
- Find deserialization errors
- Produces a data table collecting all deserialization errors of serialized LSTs.
- org.openrewrite.FindGitProvenance
- Show Git source control metadata
- List out the contents of each unique
GitProvenancemarker in the set of source files. When everything is working correctly, exactly one such marker should be printed as all source files are expected to come from the same repository / branch / commit hash.
- org.openrewrite.FindLstProvenance
- Find LST provenance
- Produces a data table showing what versions of OpenRewrite/Moderne tooling was used to produce a given LST.
- org.openrewrite.FindParseFailures
- Find source files with
ParseExceptionResultmarkers - This recipe explores parse failures after an LST is produced for classifying the types of failures that can occur and prioritizing fixes according to the most common problems.
- Find source files with
- org.openrewrite.FindQuarks
- Find instances of type
Quark Quarksource files are pointers to the existence of a file without capturing any of the contents of the file.
- Find instances of type
- org.openrewrite.IsInRepository
- Is in repository
- A search recipe which marks files that are in a repository with one of the supplied names. Intended for use as a precondition for other recipes being run over many different repositories.
- org.openrewrite.ListRuntimeClasspath
- List runtime classpath
- A diagnostic utility which emits the runtime classpath to a data table.
- org.openrewrite.MoveFile
- Move a file
- Move a file to a different directory. The file name will remain the same.
- org.openrewrite.SetFilePermissions
- Set file permission attributes
- Set a file's read, write and executable permission attributes.
- org.openrewrite.search.FindBuildMetadata
- Find build metadata
- Find source files with matching build metadata.
- org.openrewrite.search.FindCommitters
- Find committers on repositories
- List the committers on a repository.
- org.openrewrite.search.FindParseToPrintInequality
- Find parse to print inequality
- OpenRewrite
Parserimplementations should produceSourceFileobjects whoseprintAll()method should be byte-for-byte equivalent with the original source file. When this isn't true, recipes can still run on theSourceFileand even produce diffs, but the diffs would fail to apply as a patch to the original source file. MostParseruseParser#requirePrintEqualsInputto produce aParseErrorwhen they fail to produce aSourceFilethat is print idempotent.
- org.openrewrite.search.RepositoryContainsFile
- Repository contains file
- Intended to be used primarily as a precondition for other recipes, this recipe checks if a repository contains a specific file or files matching a pattern. If present all files in the repository are marked with a
SearchResultmarker. If you want to get only the matching file as a search result, useFindSourceFilesinstead.
- org.openrewrite.text.AppendToTextFile
- Append to text file
- Appends or replaces content of an existing plain text file, or creates a new one if it doesn't already exist. Please note that this recipes requires existing plain text files' format to be successfully parsable by OpenRewrite. If a file is left unchanged, it might be parsed as a
Quarkrather than plain text. In such case, use theplainTextMaskoption. See the Gradle or Maven plugin configuration page.
- org.openrewrite.text.ChangeText
- Change text
- Completely replaces the contents of the text file with other text. Use together with a
FindSourceFilesprecondition to limit which files are changed.
- org.openrewrite.text.EndOfLineAtEndOfFile
- End of Line @ End of File (EOL @ EOF)
- Ensure that the file ends with the newline character. Note: If this recipe modifies a file, it converts the file into plain text. As such, this recipe should be run after any recipe that modifies the language-specific LST.
- org.openrewrite.text.FindMultiselect
- Experimental find text with multiselect
- Search for text, treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
- org.openrewrite.text.RemoveByteOrderMark
- Remove byte order mark (BOM)
- Removes UTF-8 byte order marks from the beginning of files. The BOM character (U+FEFF) is generally unnecessary in UTF-8 files and can cause issues with some tools.
rewrite-cryptography
- io.moderne.cryptography.FindRSAKeyGenParameters
- Find RSA key generation parameters
- Finds RSAKeyGenParameterSpec instantiations and extracts their parameter values into a data table.
- io.moderne.cryptography.FindSSLSocketParameters
- Find SSL socket configuration parameters
- Finds SSLSocket setter method invocations and extracts their parameter values into a data table.
- io.moderne.cryptography.FindSecurityModifications
- Find Security class modifications
- Finds invocations of java.security.Security methods that modify security configuration such as removeProvider, addProvider, insertProviderAt, setProperty, and removeProperty.
rewrite-csharp
- org.openrewrite.csharp.recipes.meziantou.analyzer.AbstractTypesShouldNotHaveConstructorsMA0017
- Abstract types should not have public or internal constructors
- org.openrewrite.csharp.recipes.meziantou.analyzer.ArgumentExceptionShouldSpecifyArgumentNameMA0043
- Use nameof operator in ArgumentException
- org.openrewrite.csharp.recipes.meziantou.analyzer.AvoidComparisonWithBoolConstantMA0073
- Avoid comparison with bool constant
- org.openrewrite.csharp.recipes.meziantou.analyzer.AvoidUsingRedundantElseMA0071
- Avoid using redundant else
- The 'if' block contains a jump statement (break, continue, goto, return, throw, yield break). Using 'else' is redundant and needlessly maintains a higher nesting level.
- org.openrewrite.csharp.recipes.meziantou.analyzer.ClassMustBeSealedMA0053
- Make class sealed
- org.openrewrite.csharp.recipes.meziantou.analyzer.CommaMA0007
- Add a comma after the last value
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotRemoveOriginalExceptionFromThrowStatementMA0027
- Prefer rethrowing an exception implicitly
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseBlockingCallInAsyncContextMA0042
- Do not use blocking calls in an async method
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseBlockingCallInAsyncContextMA0045
- Do not use blocking calls in a sync method (need to make calling method async)
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseEqualityComparerDefaultOfStringMA0024
- Use an explicit StringComparer when possible
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseEqualityOperatorsForSpanOfCharMA0103
- Use SequenceEqual instead of equality operator
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseStringGetHashCodeMA0021
- Use StringComparer.GetHashCode instead of string.GetHashCode
- org.openrewrite.csharp.recipes.meziantou.analyzer.EqualityShouldBeCorrectlyImplementedMA0077
- A class that provides Equals(T) should implement IEquatable<T>
- org.openrewrite.csharp.recipes.meziantou.analyzer.EventsShouldHaveProperArgumentsMA0091
- Sender should be 'this' for instance events
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeClassStaticMA0036
- Make class static
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeInterpolatedStringMA0165
- Make interpolated string
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMemberReadOnlyMA0102
- Make member readonly
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMethodStaticMA0038
- Make method static (deprecated, use CA1822 instead)
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMethodStaticMA0041
- Make property static (deprecated, use CA1822 instead)
- org.openrewrite.csharp.recipes.meziantou.analyzer.MarkAttributesWithAttributeUsageAttributeMA0010
- Mark attributes with AttributeUsageAttribute
- org.openrewrite.csharp.recipes.meziantou.analyzer.MethodOverridesShouldNotChangeParameterDefaultsMA0061
- Method overrides should not change default values
- org.openrewrite.csharp.recipes.meziantou.analyzer.NamedParameterMA0003
- Add parameter name to improve readability
- org.openrewrite.csharp.recipes.meziantou.analyzer.NotPatternShouldBeParenthesizedCodeMA0164
- Use parentheses to make not pattern clearer
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0020
- Use direct methods instead of LINQ methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0029
- Combine LINQ methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0030
- Remove useless OrderBy call
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0031
- Optimize Enumerable.Count() usage
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0078
- Use 'Cast' instead of 'Select' to cast
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0098
- Use indexer instead of LINQ methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0159
- Use 'Order' instead of 'OrderBy'
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeStartsWithMA0089
- Optimize string method usage
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeStringBuilderUsageMA0028
- Optimize StringBuilder usage
- org.openrewrite.csharp.recipes.meziantou.analyzer.ParameterAttributeForRazorComponentMA0116
- Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter]
- org.openrewrite.csharp.recipes.meziantou.analyzer.ParameterAttributeForRazorComponentMA0117
- Parameters with [EditorRequired] attributes should also be marked as [Parameter]
- org.openrewrite.csharp.recipes.meziantou.analyzer.PreserveParamsOnOverrideMA0081
- Method overrides should not omit params keyword
- org.openrewrite.csharp.recipes.meziantou.analyzer.RemoveEmptyStatementMA0037
- Remove empty statement
- org.openrewrite.csharp.recipes.meziantou.analyzer.RemoveUselessToStringMA0044
- Remove useless ToString call
- org.openrewrite.csharp.recipes.meziantou.analyzer.ReplaceEnumToStringWithNameofMA0052
- Replace constant Enum.ToString with nameof
- org.openrewrite.csharp.recipes.meziantou.analyzer.ReturnTaskFromResultInsteadOfReturningNullMA0022
- Return Task.FromResult instead of returning null
- org.openrewrite.csharp.recipes.meziantou.analyzer.SimplifyCallerArgumentExpressionMA0108
- Remove redundant argument value
- org.openrewrite.csharp.recipes.meziantou.analyzer.StringShouldNotContainsNonDeterministicEndOfLineMA0101
- String contains an implicit end of line character
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasCancellationTokenFixer_ArgumentMA0040
- Forward the CancellationToken parameter to methods that take one
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasCancellationTokenFixer_AwaitForEachMA0079
- Forward the CancellationToken using .WithCancellation()
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasTimeProviderMA0166
- Forward the TimeProvider to methods that take one
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseArrayEmptyMA0005
- Use Array.Empty<T>()
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseConfigureAwaitMA0004
- Use Task.ConfigureAwait
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseDateTimeUnixEpochMA0113
- Use DateTime.UnixEpoch
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseDateTimeUnixEpochMA0114
- Use DateTimeOffset.UnixEpoch
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseEventArgsEmptyMA0019
- Use EventArgs.Empty
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseEventArgsEmptyMA0093
- EventArgs should not be null
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseGuidEmptyMA0067
- Use Guid.Empty
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseIsPatternInsteadOfSequenceEqualMA0128
- Use 'is' operator instead of SequenceEqual
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedMA0120
- Use InvokeVoidAsync when the returned value is not used
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseLangwordInXmlCommentMA0154
- Use langword in XML comment
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0141
- Use pattern matching instead of inequality operators for null check
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0142
- Use pattern matching instead of equality operators for null check
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0148
- Use pattern matching instead of equality operators for discrete value
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0149
- Use pattern matching instead of inequality operators for discrete value
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseRegexSourceGeneratorMA0110
- Use the Regex source generator
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparerMA0002
- IEqualityComparer<string> or IComparer<string> is missing
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparisonMA0001
- StringComparison is missing
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparisonMA0074
- Avoid implicit culture-sensitive methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringCreateInsteadOfFormattableStringMA0111
- Use string.Create instead of FormattableString
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringEqualsMA0006
- Use String.Equals instead of equality operator
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStructLayoutAttributeMA0008
- Add StructLayoutAttribute
- org.openrewrite.csharp.recipes.meziantou.analyzer.ValidateArgumentsCorrectlyMA0050
- Validate arguments correctly in iterator methods
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AbstractTypesShouldNotHaveConstructorsCA1012
- Abstract types should not have public constructors
- Constructors on abstract types can be called only by derived types. Because public constructors create instances of a type, and you cannot create instances of an abstract type, an abstract type that has a public constructor is incorrectly designed.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidConstArraysCA1861
- Avoid constant arrays as arguments
- Constant arrays passed as arguments are not reused when called repeatedly, which implies a new array is created each time. Consider extracting them to 'static readonly' fields to improve performance if the passed array is not mutated within the called method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidLengthCalculationWhenSlicingToEndCA1514
- Avoid redundant length argument
- An explicit length calculation can be error-prone and can be avoided when slicing to end of the buffer.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnreliableStreamReadCA2022
- Avoid inexact read with 'Stream.Read'
- A call to 'Stream.Read' may return fewer bytes than requested, resulting in unreliable code if the return value is not checked.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnsealedAttributesCA1813
- Avoid unsealed attributes
- The .NET Framework class library provides methods for retrieving custom attributes. By default, these methods search the attribute inheritance hierarchy. Sealing the attribute eliminates the search through the inheritance hierarchy and can improve performance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnusedPrivateFieldsCA1823
- Avoid unused private fields
- Private fields were detected that do not appear to be accessed in the assembly.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidZeroLengthArrayAllocationsCA1825
- Avoid zero-length array allocations
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpAvoidDuplicateElementInitializationCA2244
- Do not duplicate indexed element initializations
- Indexed elements in objects initializers must initialize unique elements. A duplicate index might overwrite a previous element initialization.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDisableRuntimeMarshallingCA1421
- This method uses runtime marshalling even when the 'DisableRuntimeMarshallingAttribute' is applied
- This method uses runtime marshalling even when runtime marshalling is disabled, which can cause unexpected behavior differences at runtime due to different expectations of a type's native layout.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDisposeMethodsShouldCallBaseClassDisposeCA2215
- Dispose methods should call base class dispose
- A type that implements System.IDisposable inherits from a type that also implements IDisposable. The Dispose method of the inheriting type does not call the Dispose method of the parent type. To fix a violation of this rule, call base.Dispose in your Dispose method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotCompareSpanToNullCA2265
- Do not compare Span<T> to 'null' or 'default'
- Comparing a span to 'null' or 'default' might not do what you intended. 'default' and the 'null' literal are implicitly converted to 'Span<T>.Empty'. Remove the redundant comparison or make the code more explicit by using 'IsEmpty'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotGuardCallCA1853
- Unnecessary call to 'Dictionary.ContainsKey(key)'
- Do not guard 'Dictionary.Remove(key)' with 'Dictionary.ContainsKey(key)'. The former already checks whether the key exists, and will not throw if it does not.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotGuardCallCA1868
- Unnecessary call to 'Contains(item)'
- Do not guard 'Add(item)' or 'Remove(item)' with 'Contains(item)' for the set. The former two already check whether the item exists and will return if it was added or removed.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotInitializeUnnecessarilyCA1805
- Do not initialize unnecessarily
- The .NET runtime initializes all fields of reference types to their default values before running the constructor. In most cases, explicitly initializing a field to its default value in a constructor is redundant, adding maintenance costs and potentially degrading performance (such as with increased assembly size), and the explicit initialization can be removed. In some cases, such as with static readonly fields that permanently retain their default value, consider instead changing them to be constants or properties.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA1871
- Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'
- 'ArgumentNullException.ThrowIfNull' accepts an 'object', so passing a nullable struct may cause the value to be boxed.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA2264
- Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'
- 'ArgumentNullException.ThrowIfNull' throws when the passed argument is 'null'. Certain constructs like non-nullable structs, 'nameof()' and 'new' expressions are known to never be null, so 'ArgumentNullException.ThrowIfNull' will never throw.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseCountWhenAnyCanBeUsedCA1827
- Do not use Count() or LongCount() when Any() can be used
- For non-empty collections, Count() and LongCount() enumerate the entire sequence, while Any() stops at the first item or the first item that satisfies a condition.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseCountWhenAnyCanBeUsedCA1828
- Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
- For non-empty collections, CountAsync() and LongCountAsync() enumerate the entire sequence, while AnyAsync() stops at the first item or the first item that satisfies a condition.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyCA1826
- Do not use Enumerable methods on indexable collections
- This collection is directly indexable. Going through LINQ here causes unnecessary allocations and CPU work.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDynamicInterfaceCastableImplementationCA2256
- All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface
- Types attributed with 'DynamicInterfaceCastableImplementationAttribute' act as an interface implementation for a type that implements the 'IDynamicInterfaceCastable' type. As a result, it must provide an implementation of all of the members defined in the inherited interfaces, because the type that implements 'IDynamicInterfaceCastable' will not provide them otherwise.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDynamicInterfaceCastableImplementationCA2257
- Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static'
- Since a type that implements 'IDynamicInterfaceCastable' may not implement a dynamic interface in metadata, calls to an instance interface member that is not an explicit implementation defined on this type are likely to fail at runtime. Mark new interface members 'static' to avoid runtime errors.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpEnumStorageShouldBeInt32CA1028
- Enum Storage should be Int32
- An enumeration is a value type that defines a set of related named constants. By default, the System.Int32 data type is used to store the constant value. Although you can change this underlying type, it is not required or recommended for most scenarios.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpEnumsShouldHaveZeroValueCA1008
- Enums should have zero value
- The default value of an uninitialized enumeration, just as other value types, is zero. A nonflags-attributed enumeration should define a member by using the value of zero so that the default value is a valid value of the enumeration. If an enumeration that has the FlagsAttribute attribute applied defines a zero-valued member, its name should be ""None"" to indicate that no values have been set in the enumeration.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpForwardCancellationTokenToInvocationsCA2016
- Forward the 'CancellationToken' parameter to methods
- Forward the 'CancellationToken' parameter to methods to ensure the operation cancellation notifications gets properly propagated, or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpIdentifiersShouldNotContainUnderscoresCA1707
- Identifiers should not contain underscores
- By convention, identifier names do not contain the underscore (_) character. This rule checks namespaces, types, members, and parameters.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMakeTypesInternalCA1515
- Consider making public types internal
- Unlike a class library, an application's API isn't typically referenced publicly, so types can be marked internal.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMarkAllNonSerializableFieldsCA2235
- Mark all non-serializable fields
- An instance field of a type that is not serializable is declared in a type that is serializable.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMarkMembersAsStaticCA1822
- Mark members as static
- Members that do not access instance data or call instance methods can be marked as static. After you mark the methods as static, the compiler will emit nonvirtual call sites to these members. This can give you a measurable performance gain for performance-sensitive code.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpOverrideEqualsAndOperatorEqualsOnValueTypesCA1815
- Override equals and operator equals on value types
- For value types, the inherited implementation of Equals uses the Reflection library and compares the contents of all fields. Reflection is computationally expensive, and comparing every field for equality might be unnecessary. If you expect users to compare or sort instances, or to use instances as hash table keys, your value type should implement Equals.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferAsSpanOverSubstringCA1846
- Prefer 'AsSpan' over 'Substring'
- 'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryContainsMethodsCA1841
- Prefer Dictionary.Contains methods
- 'ContainsKey' is usually O(1), while 'Keys.Contains' may be O(n) in some cases. Additionally, many dictionary implementations lazily initialize the Keys collection to cut back on allocations.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1854
- Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method
- Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check. 'ContainsKey' and the indexer both would lookup the key under the hood, so using 'TryGetValue' removes the extra lookup.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1864
- Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
- Prefer a 'TryAdd' call over an 'Add' call guarded by a 'ContainsKey' check. 'TryAdd' behaves the same as 'Add', except that when the specified key already exists, it returns 'false' instead of throwing an exception.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferGenericOverloadsCA2263
- Prefer generic overload when type is known
- Using a generic overload is preferable to the 'System.Type' overload when the type is known, promoting cleaner and more type-safe code with improved compile-time checks.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferHashDataOverComputeHashCA1850
- Prefer static 'HashData' method over 'ComputeHash'
- It is more efficient to use the static 'HashData' method over creating and managing a HashAlgorithm instance to call 'ComputeHash'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferIsEmptyOverCountCA1836
- Prefer IsEmpty over Count
- For determining whether the object contains or not any items, prefer using 'IsEmpty' property rather than retrieving the number of items from the 'Count' property and comparing it to 0 or 1.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferLengthCountIsEmptyOverAnyCA1860
- Avoid using 'Enumerable.Any()' extension method
- Prefer using 'IsEmpty', 'Count' or 'Length' properties whichever available, rather than calling 'Enumerable.Any()'. The intent is clearer and it is more performant than using 'Enumerable.Any()' extension method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferStreamAsyncMemoryOverloadsCA1835
- Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
- 'Stream' has a 'ReadAsync' overload that takes a 'Memory<Byte>' as the first argument, and a 'WriteAsync' overload that takes a 'ReadOnlyMemory<Byte>' as the first argument. Prefer calling the memory based overloads, which are more efficient.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpRecommendCaseInsensitiveStringComparisonCA1862
- Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
- Avoid calling 'ToLower', 'ToUpper', 'ToLowerInvariant' and 'ToUpperInvariant' to perform case-insensitive string comparisons because they lead to an allocation. Instead, prefer calling the method overloads of 'Contains', 'IndexOf' and 'StartsWith' that take a 'StringComparison' enum value to perform case-insensitive comparisons. Switching to using an overload that takes a 'StringComparison' might cause subtle changes in behavior, so it's important to conduct thorough testing after applying the suggestion. Additionally, if a culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpSpecifyCultureForToLowerAndToUpperCA1311
- Specify a culture or use an invariant version
- Specify culture to help avoid accidental implicit dependency on current culture. Using an invariant version yields consistent results regardless of the culture of an application.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpSpecifyMarshalingForPInvokeStringArgumentsCA2101
- Specify marshaling for P/Invoke string arguments
- A platform invoke member allows partially trusted callers, has a string parameter, and does not explicitly marshal the string. This can cause a potential security vulnerability.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpStaticHolderTypesCA1052
- Static holder types should be Static or NotInheritable
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpTestForEmptyStringsUsingStringLengthCA1820
- Test for empty strings using string length
- Comparing strings by using the String.Length property or the String.IsNullOrEmpty method is significantly faster than using Equals.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpTestForNaNCorrectlyCA2242
- Test for NaN correctly
- This expression tests a value against Single.Nan or Double.Nan. Use Single.IsNan(Single) or Double.IsNan(Double) to test the value.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1831
- Use AsSpan or AsMemory instead of Range-based indexers when appropriate
- The Range-based indexer on string values produces a copy of requested portion of the string. This copy is usually unnecessary when it is implicitly used as a ReadOnlySpan or ReadOnlyMemory value. Use the AsSpan method to avoid the unnecessary copy.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1832
- Use AsSpan or AsMemory instead of Range-based indexers when appropriate
- The Range-based indexer on array values produces a copy of requested portion of the array. This copy is usually unnecessary when it is implicitly used as a ReadOnlySpan or ReadOnlyMemory value. Use the AsSpan method to avoid the unnecessary copy.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1833
- Use AsSpan or AsMemory instead of Range-based indexers when appropriate
- The Range-based indexer on array values produces a copy of requested portion of the array. This copy is often unwanted when it is implicitly used as a Span or Memory value. Use the AsSpan method to avoid the copy.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseLiteralsWhereAppropriateCA1802
- Use literals where appropriate
- A field is declared static and read-only (Shared and ReadOnly in Visual Basic), and is initialized by using a value that is computable at compile time. Because the value that is assigned to the targeted field is computable at compile time, change the declaration to a const (Const in Visual Basic) field so that the value is computed at compile time instead of at runtime.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseOrdinalStringComparisonCA1309
- Use ordinal string comparison
- A string comparison operation that is nonlinguistic does not set the StringComparison parameter to either Ordinal or OrdinalIgnoreCase. By explicitly setting the parameter to either StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase, your code often gains speed, becomes more correct, and becomes more reliable.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUsePropertyInsteadOfCountMethodWhenAvailableCA1829
- Use Length/Count property instead of Count() when available
- Enumerable.Count() potentially enumerates the sequence while a Length/Count property is a direct access.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSearchValuesCA1870
- Use a cached 'SearchValues' instance
- Using a cached 'SearchValues' instance is more efficient than passing values to 'IndexOfAny'/'ContainsAny' directly.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSpanBasedStringConcatCA1845
- Use span-based 'string.Concat'
- It is more efficient to use 'AsSpan' and 'string.Concat', instead of 'Substring' and a concatenation operator.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSpanClearInsteadOfFillCA1855
- Prefer 'Clear' over 'Fill'
- It is more efficient to use 'Clear', instead of 'Fill' with default value.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStartsWithInsteadOfIndexOfComparisonWithZeroCodeFixCA1858
- Use 'StartsWith' instead of 'IndexOf'
- It is both clearer and faster to use 'StartsWith' instead of comparing the result of 'IndexOf' to zero.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStringContainsCharOverloadWithSingleCharactersCA1847
- Use char literal for a single character lookup
- 'string.Contains(char)' is available as a better performing overload for single char lookup.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStringMethodCharOverloadWithSingleCharactersCA1865
- Use char overload
- The char overload is a better performing overload than a string with a single char.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DefineAccessorsForAttributeArgumentsCA1019
- Define accessors for attribute arguments
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueCA2009
- Do not call ToImmutableCollection on an ImmutableCollection value
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotCreateTaskCompletionSourceWithWrongArgumentsCA2247
- Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum
- TaskCompletionSource has constructors that take TaskCreationOptions that control the underlying Task, and constructors that take object state that's stored in the task. Accidentally passing a TaskContinuationOptions instead of a TaskCreationOptions will result in the call treating the options as state.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotDirectlyAwaitATaskCA2007
- Consider calling ConfigureAwait on the awaited task
- When an asynchronous method awaits a Task directly, continuation occurs in the same thread that created the task. Consider calling Task.ConfigureAwait(Boolean) to signal your intention for continuation. Call ConfigureAwait(false) on the task to schedule continuations to the thread pool, thereby avoiding a deadlock on the UI thread. Passing false is a good option for app-independent libraries. Calling ConfigureAwait(true) on the task has the same behavior as not explicitly calling ConfigureAwait. By explicitly calling this method, you're letting readers know you intentionally want to perform the continuation on the original synchronization context.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1842
- Do not use 'WhenAll' with a single task
- Using 'WhenAll' with a single task may result in performance loss, await or return the task instead.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1843
- Do not use 'WaitAll' with a single task
- Using 'WaitAll' with a single task may result in performance loss, await or return the task instead.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EnumWithFlagsAttributeCA1027
- Mark enums with FlagsAttribute
- An enumeration is a value type that defines a set of related named constants. Apply FlagsAttribute to an enumeration when its named constants can be meaningfully combined.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EnumWithFlagsAttributeCA2217
- Do not mark enums with FlagsAttribute
- An externally visible enumeration is marked by using FlagsAttribute, and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EquatableCA1066
- Implement IEquatable when overriding Object.Equals
- When a type T overrides Object.Equals(object), the implementation must cast the object argument to the correct type T before performing the comparison. If the type implements IEquatable<T>, and therefore offers the method T.Equals(T), and if the argument is known at compile time to be of type T, then the compiler can call IEquatable<T>.Equals(T) instead of Object.Equals(object), and no cast is necessary, improving performance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EquatableCA1067
- Override Object.Equals(object) when implementing IEquatable<T>
- When a type T implements the interface IEquatable<T>, it suggests to a user who sees a call to the Equals method in source code that an instance of the type can be equated with an instance of any other type. The user might be confused if their attempt to equate the type with an instance of another type fails to compile. This violates the "principle of least surprise".
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ExceptionsShouldBePublicCA1064
- Exceptions should be public
- An internal exception is visible only inside its own internal scope. After the exception falls outside the internal scope, only the base exception can be used to catch the exception. If the internal exception is inherited from T:System.Exception, T:System.SystemException, or T:System.ApplicationException, the external code will not have sufficient information to know what to do with the exception.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ImplementStandardExceptionConstructorsCA1032
- Implement standard exception constructors
- Failure to provide the full set of constructors can make it difficult to correctly handle exceptions.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.InstantiateArgumentExceptionsCorrectlyCA2208
- Instantiate argument exceptions correctly
- A call is made to the default (parameterless) constructor of an exception type that is or derives from ArgumentException, or an incorrect string argument is passed to a parameterized constructor of an exception type that is or derives from ArgumentException.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.InterfaceMethodsShouldBeCallableByChildTypesCA1033
- Interface methods should be callable by child types
- An unsealed externally visible type provides an explicit method implementation of a public interface and does not provide an alternative externally visible method that has the same name.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.MarkAttributesWithAttributeUsageCA1018
- Mark attributes with AttributeUsageAttribute
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.MarkTypesWithSerializableCA2237
- Mark ISerializable types with serializable
- To be recognized by the common language runtime as serializable, types must be marked by using the SerializableAttribute attribute even when the type uses a custom serialization routine through implementation of the ISerializable interface.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OperatorOverloadsHaveNamedAlternatesCA2225
- Operator overloads have named alternates
- An operator overload was detected, and the expected named alternative method was not found. The named alternative member provides access to the same functionality as the operator and is provided for developers who program in languages that do not support overloaded operators.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OperatorsShouldHaveSymmetricalOverloadsCA2226
- Operators should have symmetrical overloads
- A type implements the equality or inequality operator and does not implement the opposite operator.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OverloadOperatorEqualsOnOverridingValueTypeEqualsCA2231
- Overload operator equals on overriding value type Equals
- In most programming languages there is no default implementation of the equality operator (==) for value types. If your programming language supports operator overloads, you should consider implementing the equality operator. Its behavior should be identical to that of Equals.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OverrideMethodsOnComparableTypesCA1036
- Override methods on comparable types
- A public or protected type implements the System.IComparable interface. It does not override Object.Equals nor does it overload the language-specific operator for equality, inequality, less than, less than or equal, greater than or greater than or equal.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ParameterNamesShouldMatchBaseDeclarationCA1725
- Parameter names should match base declaration
- Consistent naming of parameters in an override hierarchy increases the usability of the method overrides. A parameter name in a derived method that differs from the name in the base declaration can cause confusion about whether the method is an override of the base method or a new overload of the method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferConstCharOverConstUnitStringCA1834
- Consider using 'StringBuilder.Append(char)' when applicable
- 'StringBuilder.Append(char)' is more efficient than 'StringBuilder.Append(string)' when the string is a single character. When calling 'Append' with a constant, prefer using a constant char rather than a constant string containing one character.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferConvertToHexStringOverBitConverterCA1872
- Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'
- Use 'Convert.ToHexString' or 'Convert.ToHexStringLower' when encoding bytes to a hexadecimal string representation. These methods are more efficient and allocation-friendly than using 'BitConverter.ToString' in combination with 'String.Replace' to replace dashes and 'String.ToLower'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferStringContainsOverIndexOfCA2249
- Consider using 'string.Contains' instead of 'string.IndexOf'
- Calls to 'string.IndexOf' where the result is used to check for the presence/absence of a substring can be replaced by 'string.Contains'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferTypedStringBuilderAppendOverloadsCA1830
- Prefer strongly-typed Append and Insert method overloads on StringBuilder
- StringBuilder.Append and StringBuilder.Insert provide overloads for multiple types beyond System.String. When possible, prefer the strongly-typed overloads over using ToString() and the string-based overload.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ProvidePublicParameterlessSafeHandleConstructorCA1419
- Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle'
- Providing a parameterless constructor that is as visible as the containing type for a type derived from 'System.Runtime.InteropServices.SafeHandle' enables better performance and usage with source-generated interop solutions.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.RemoveEmptyFinalizersCA1821
- Remove empty Finalizers
- Finalizers should be avoided where possible, to avoid the additional performance overhead involved in tracking object lifetime.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.RethrowToPreserveStackDetailsCA2200
- Rethrow to preserve stack details
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.SealInternalTypesCA1852
- Seal internal types
- When a type is not accessible outside its assembly and has no subtypes within its containing assembly, it can be safely sealed. Sealing types can improve performance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.SealMethodsThatSatisfyPrivateInterfacesCA2119
- Seal methods that satisfy private interfaces
- An inheritable public type provides an overridable method implementation of an internal (Friend in Visual Basic) interface. To fix a violation of this rule, prevent the method from being overridden outside the assembly.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.TypesThatOwnDisposableFieldsShouldBeDisposableCA1001
- Types that own disposable fields should be disposable
- A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UriParametersShouldNotBeStringsCA1054
- URI-like parameters should not be strings
- This rule assumes that the parameter represents a Uniform Resource Identifier (URI). A string representation or a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. 'System.Uri' class provides these services in a safe and secure manner.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseCancellationTokenThrowIfCancellationRequestedCA2250
- Use 'ThrowIfCancellationRequested'
- 'ThrowIfCancellationRequested' automatically checks whether the token has been canceled, and throws an 'OperationCanceledException' if it has.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1837
- Use 'Environment.ProcessId'
- 'Environment.ProcessId' is simpler and faster than 'Process.GetCurrentProcess().Id'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1839
- Use 'Environment.ProcessPath'
- 'Environment.ProcessPath' is simpler and faster than 'Process.GetCurrentProcess().MainModule.FileName'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1840
- Use 'Environment.CurrentManagedThreadId'
- 'Environment.CurrentManagedThreadId' is simpler and faster than 'Thread.CurrentThread.ManagedThreadId'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1510
- Use ArgumentNullException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1511
- Use ArgumentException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1512
- Use ArgumentOutOfRangeException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1513
- Use ObjectDisposedException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseNameOfInPlaceOfStringCA1507
- Use nameof to express symbol names
- Using nameof helps keep your code valid when refactoring.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseStringEqualsOverStringCompareCA2251
- Use 'string.Equals'
- It is both clearer and likely faster to use 'string.Equals' instead of comparing the result of 'string.Compare' to zero.
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1001
- Add braces (when expression spans over multiple lines)
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1007
- Add braces
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1126
- Add braces to if-else
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesToIfElseRCS1003
- Add braces to if-else (when expression spans over multiple lines)
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddExceptionToDocumentationCommentRCS1140
- Add exception to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddOrRemoveParenthesesWhenCreatingNewObjectRCS1050
- Include/omit parentheses when creating new object
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddOrRemoveTrailingCommaRCS1260
- Add/remove trailing comma
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddParagraphToDocumentationCommentRCS1226
- Add paragraph to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddParenthesesWhenNecessaryRCS1123
- Add parentheses when necessary
- org.openrewrite.csharp.recipes.roslynator.analyzers.AnonymousMethodRCS1048
- Use lambda expression instead of anonymous method
- org.openrewrite.csharp.recipes.roslynator.analyzers.AssignmentExpressionRCS1089
- Use --/++ operator instead of assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.AssignmentExpressionRCS1114
- Remove redundant delegate creation
- org.openrewrite.csharp.recipes.roslynator.analyzers.AttributeArgumentListRCS1039
- Remove argument list from attribute
- org.openrewrite.csharp.recipes.roslynator.analyzers.AvoidBoxingOfValueTypeRCS1198
- Avoid unnecessary boxing of value type
- org.openrewrite.csharp.recipes.roslynator.analyzers.AvoidNullReferenceExceptionRCS1202
- Avoid NullReferenceException
- org.openrewrite.csharp.recipes.roslynator.analyzers.AwaitExpressionRCS1090
- Add/remove 'ConfigureAwait(false)' call
- org.openrewrite.csharp.recipes.roslynator.analyzers.BaseArgumentListRCS1205
- Order named arguments according to the order of parameters
- org.openrewrite.csharp.recipes.roslynator.analyzers.BaseTypeRCS1182
- Remove redundant base interface
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1098
- Constant values should be placed on right side of comparisons
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1113
- Use 'string.IsNullOrEmpty' method
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1143
- Simplify coalesce expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1145
- Remove redundant 'as' operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1156
- Use string.Length instead of comparison with empty string
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1165
- Unconstrained type parameter checked for null
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1166
- Value type object is never equal to null
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1190
- Join string expressions
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1195
- Use ^ operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1199
- Unnecessary null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1233
- Use short-circuiting operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1240
- Operator is unnecessary
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1268
- Simplify numeric comparison
- org.openrewrite.csharp.recipes.roslynator.analyzers.BlockRCS1031
- Remove unnecessary braces in switch section
- org.openrewrite.csharp.recipes.roslynator.analyzers.BlockRCS1171
- Simplify lazy initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.CaseSwitchLabelRCS1069
- Remove unnecessary case label
- org.openrewrite.csharp.recipes.roslynator.analyzers.CastExpressionRCS1257
- Use enum field explicitly
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1102
- Make class static
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1108
- Add 'static' modifier to all partial class declarations
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1194
- Implement exception constructors
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1203
- Use AttributeUsageAttribute
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1225
- Make class sealed
- org.openrewrite.csharp.recipes.roslynator.analyzers.CompositeEnumValueContainsUndefinedFlagRCS1157
- Composite enum value contains undefined flag
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1084
- Use coalesce expression instead of conditional expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1104
- Simplify conditional expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1206
- Use conditional access instead of conditional expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1238
- Avoid nested ?: operators
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1071
- Remove redundant base constructor call
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1074
- Remove redundant constructor
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1160
- Abstract type should not have public constructors
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConvertLambdaExpressionBodyToExpressionBodyRCS1021
- Convert lambda expression body to expression body
- org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareEachAttributeSeparatelyRCS1052
- Declare each attribute separately
- org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareEnumMemberWithZeroValueRCS1135
- Declare enum member with zero value (when enum has FlagsAttribute)
- org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareTypeInsideNamespaceRCS1110
- Declare type inside namespace
- org.openrewrite.csharp.recipes.roslynator.analyzers.DefaultExpressionRCS1244
- Simplify 'default' expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.DestructorDeclarationRCS1106
- [deprecated] Remove empty destructor
- org.openrewrite.csharp.recipes.roslynator.analyzers.DirectiveTriviaRCS1222
- Merge preprocessor directives
- org.openrewrite.csharp.recipes.roslynator.analyzers.DisposeResourceAsynchronouslyRCS1261
- Resource can be disposed asynchronously
- org.openrewrite.csharp.recipes.roslynator.analyzers.DoStatementRCS1063
- [deprecated] Avoid usage of do statement to create an infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.DocumentRCS1093
- File contains no code
- org.openrewrite.csharp.recipes.roslynator.analyzers.DocumentationCommentRCS1139
- Add summary element to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.DuplicateWordInCommentRCS1243
- Duplicate word in a comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.ElseClauseRCS1006
- Merge 'else' with nested 'if'
- org.openrewrite.csharp.recipes.roslynator.analyzers.ElseClauseRCS1040
- [deprecated] Remove empty 'else' clause
- org.openrewrite.csharp.recipes.roslynator.analyzers.EmptyStatementRCS1038
- [deprecated] Remove empty statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.EndRegionDirectiveTriviaRCS1189
- Add or remove region name
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1154
- Sort enum members
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1161
- Enum should declare explicit values
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1237
- [deprecated] Use bit shift operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1191
- Declare enum value as combination of names
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1234
- Duplicate enum value
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1254
- Normalize format of enum flag value
- org.openrewrite.csharp.recipes.roslynator.analyzers.ExpressionRCS1051
- Add/remove parentheses from condition in conditional operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.ExpressionRCS1215
- Expression is always equal to true/false
- org.openrewrite.csharp.recipes.roslynator.analyzers.ExtractMemberToNewDocumentRCS1060
- Declare each type in separate file
- org.openrewrite.csharp.recipes.roslynator.analyzers.FinallyClauseRCS1066
- [deprecated] Remove empty 'finally' clause
- org.openrewrite.csharp.recipes.roslynator.analyzers.ForStatementRCS1064
- [deprecated] Avoid usage of for statement to create an infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1061
- Merge 'if' with nested 'if'
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1073
- Convert 'if' to 'return' statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1103
- Convert 'if' to assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1173
- Use coalesce expression instead of 'if'
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1208
- Reduce 'if' nesting
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1236
- Use exception filter
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1255
- Simplify argument null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.ImplementNonGenericCounterpartRCS1241
- Implement non-generic counterpart
- org.openrewrite.csharp.recipes.roslynator.analyzers.InitializerRCS1035
- [deprecated] Remove redundant comma in initializer
- org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolatedStringRCS1214
- Unnecessary interpolated string
- org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolatedStringRCS1217
- Convert interpolated string to concatenation
- org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolationRCS1105
- Unnecessary interpolation
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvalidArgumentNullCheckRCS1256
- Invalid argument null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1080
- Use 'Count/Length' property instead of 'Any' method
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1097
- Remove redundant 'ToString' call
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1107
- Remove redundant 'ToCharArray' call
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1112
- Combine 'Enumerable.Where' method chain
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1196
- Call extension method as instance method
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1200
- Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1267
- Use string interpolation instead of 'string.Concat'
- org.openrewrite.csharp.recipes.roslynator.analyzers.LocalDeclarationStatementRCS1124
- Inline local variable
- org.openrewrite.csharp.recipes.roslynator.analyzers.LockStatementRCS1059
- Avoid locking on publicly accessible instance
- org.openrewrite.csharp.recipes.roslynator.analyzers.MarkLocalVariableAsConstRCS1118
- Mark local variable as const
- org.openrewrite.csharp.recipes.roslynator.analyzers.MarkTypeWithDebuggerDisplayAttributeRCS1223
- Mark publicly visible type with DebuggerDisplay attribute
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1018
- Add/remove accessibility modifiers
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1019
- Order modifiers
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1034
- Remove redundant 'sealed' modifier
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1055
- Unnecessary semicolon at the end of declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1132
- Remove redundant overriding member
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1169
- Make field read-only
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1170
- Use read-only auto-implemented property
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1181
- Convert comment to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1187
- Use constant instead of field
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1224
- Make method an extension method
- org.openrewrite.csharp.recipes.roslynator.analyzers.NamespaceDeclarationRCS1072
- [deprecated] Remove empty namespace declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.NamespaceDeclarationRCS1094
- Declare using directive on top level
- org.openrewrite.csharp.recipes.roslynator.analyzers.NormalizeNullCheckProviderRCS1248
- Normalize null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.NormalizeUsageOfInfiniteLoopRCS1252
- Normalize usage of infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.ObjectCreationExpressionRCS1204
- Use EventArgs.Empty
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeLinqMethodCallRCS1077
- Optimize LINQ method call
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeLinqMethodCallRCS1246
- Use element access
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeMethodCallRCS1235
- Optimize method call
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeStringBuilderAppendCallRCS1197
- Optimize StringBuilder.Append/AppendLine call
- org.openrewrite.csharp.recipes.roslynator.analyzers.OrderElementsInDocumentationCommentRCS1232
- Order elements in documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.OrderTypeParameterConstraintsRCS1209
- Order type parameter constraints
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterNameDiffersFromBaseRCS1168
- Parameter name differs from base name
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1193
- Overriding member should not change 'params' modifier
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1231
- Make parameter ref read-only
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1242
- Do not pass non-read-only struct by read-only reference
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParenthesizedExpressionRCS1032
- Remove redundant parentheses
- org.openrewrite.csharp.recipes.roslynator.analyzers.PropertyDeclarationRCS1188
- Remove redundant auto-property initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.RawStringLiteralRCS1262
- Unnecessary raw string literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.RawStringLiteralRCS1266
- Use raw string literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.RegionDirectiveTriviaRCS1091
- [deprecated] Remove empty region
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveBracesFromIfElseRCS1004
- Remove braces from if-else
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveBracesRCS1002
- Remove braces
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveElementInDocumentationCommentRCS1228
- Unused element in a documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveElementInDocumentationCommentRCS1263
- Invalid reference in a documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEmptyInitializerRCS1041
- [deprecated] Remove empty initializer
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEmptySyntaxRCS1259
- Remove empty syntax
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEnumDefaultBaseTypeRCS1042
- Remove enum default underlying type
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveOriginalExceptionRCS1044
- Remove original exception from throw statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemovePartialModifierFromTypeWithSinglePartRCS1043
- Remove 'partial' modifier from type with a single part
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantAssignmentRCS1212
- Remove redundant assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantAsyncAwaitRCS1174
- Remove redundant async/await
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantBooleanLiteralRCS1033
- Remove redundant boolean literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantCastRCS1151
- Remove redundant cast
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantCatchBlockRCS1265
- Remove redundant catch block
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveUnnecessaryBracesRCS1251
- Remove unnecessary braces from record declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveUnnecessaryElseRCS1211
- Remove unnecessary 'else'
- org.openrewrite.csharp.recipes.roslynator.analyzers.ReturnCompletedTaskInsteadOfNullRCS1210
- Return completed task instead of returning null
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyBooleanComparisonRCS1049
- Simplify boolean comparison
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyCodeBranchingRCS1218
- Simplify code branching
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyLogicalNegationRCS1068
- Simplify logical negation
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyNestedUsingStatementRCS1005
- Simplify nested using statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyNullableOfTRCS1020
- Simplify Nullable<T> to T?
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1100
- [deprecated] Format documentation summary on a single line
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1101
- [deprecated] Format documentation summary on multiple lines
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1141
- Add 'param' element to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1142
- Add 'typeparam' element to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1253
- Format documentation comment summary
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1133
- Remove redundant Dispose/Close call
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1134
- Remove redundant statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1180
- Inline lazy initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1201
- Use method chaining
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1070
- Remove redundant default switch section
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1099
- Default label should be the last label in a switch section
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1111
- Add braces to switch section with multiple statements
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1136
- Merge switch sections with equivalent content
- org.openrewrite.csharp.recipes.roslynator.analyzers.TokenRCS1249
- Unnecessary null-forgiving operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.TypeParameterRCS1164
- Unused type parameter
- org.openrewrite.csharp.recipes.roslynator.analyzers.TypeRCS1159
- Use EventHandler<T>
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryAssignmentRCS1179
- Unnecessary assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryEnumFlagRCS1258
- Unnecessary enum flag
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryExplicitUseOfEnumeratorRCS1230
- Unnecessary explicit use of enumerator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryUnsafeContextRCS1216
- Unnecessary unsafe context
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryUsageOfVerbatimStringLiteralRCS1192
- Unnecessary usage of verbatim string literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnusedMemberRCS1213
- Remove unused member declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnusedParameterRCS1163
- Unused parameter
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseAnonymousFunctionOrMethodGroupRCS1207
- Use anonymous function or method group
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseAsyncAwaitRCS1229
- Use async/await when necessary
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseAutoPropertyRCS1085
- Use auto-implemented property
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseBlockBodyOrExpressionBodyRCS1016
- Use block body or expression body
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseCoalesceExpressionRCS1128
- Use coalesce expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseCompoundAssignmentRCS1058
- Use compound assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseConditionalAccessRCS1146
- Use conditional access
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseEmptyStringLiteralOrStringEmptyRCS1078
- Use "" or 'string.Empty'
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarInForEachRCS1009
- [deprecated] Use explicit type instead of 'var' (foreach variable)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarRCS1008
- [deprecated] Use explicit type instead of 'var' (when the type is not obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarRCS1012
- [deprecated] Use explicit type instead of 'var' (when the type is obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitlyOrImplicitlyTypedArrayRCS1014
- Use explicitly/implicitly typed array
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseHasFlagMethodOrBitwiseOperatorRCS1096
- Use 'HasFlag' method or bitwise operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseImplicitOrExplicitObjectCreationRCS1250
- Use implicit/explicit object creation
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseIsOperatorInsteadOfAsOperatorRCS1172
- Use 'is' operator instead of 'as' operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseNameOfOperatorRCS1015
- Use nameof operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsePatternMatchingInsteadOfAsAndNullCheckRCS1221
- Use pattern matching instead of combination of 'as' operator and null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsePatternMatchingInsteadOfIsAndCastRCS1220
- Use pattern matching instead of combination of 'is' operator and cast operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsePredefinedTypeRCS1013
- Use predefined type
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseRegexInstanceInsteadOfStaticMethodRCS1186
- Use Regex instance instead of static method
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseStringComparisonRCS1155
- Use StringComparison when comparing strings
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1010
- [deprecated] Use 'var' instead of explicit type (when the type is obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1176
- [deprecated] Use 'var' instead of explicit type (when the type is not obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1177
- [deprecated] Use 'var' instead of explicit type (in foreach)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarOrExplicitTypeRCS1264
- Use 'var' or explicit type
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsingDirectiveRCS1056
- Avoid usage of using alias directive
- org.openrewrite.csharp.recipes.roslynator.analyzers.ValidateArgumentsCorrectlyRCS1227
- Validate arguments correctly
- org.openrewrite.csharp.recipes.roslynator.analyzers.VariableDeclarationRCS1081
- Split variable declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.VariableDeclaratorRCS1129
- Remove redundant field initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhileStatementRCS1065
- [deprecated] Avoid usage of while statement to create an infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhileStatementRCS1239
- Use 'for' statement instead of 'while' statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhitespaceTriviaRCS1036
- [deprecated] Remove unnecessary blank line
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhitespaceTriviaRCS1037
- Remove trailing white-space
- org.openrewrite.csharp.recipes.roslynator.analyzers.XmlNodeRCS1247
- Fix documentation comment tag
- org.openrewrite.csharp.recipes.stylecop.analyzers.IndentationSA1137
- Elements should have the same indentation
- Elements at the same level in the syntax tree should have the same indentation.
- org.openrewrite.csharp.recipes.stylecop.analyzers.PropertySummaryDocumentationSA1623
- Property summary documentation should match accessors
- The documentation text within a C# property’s <summary> tag does not match the accessors within the property.
- org.openrewrite.csharp.recipes.stylecop.analyzers.PropertySummaryDocumentationSA1624
- Property summary documentation should omit accessor with restricted access
- The documentation text within a C# property’s <summary> tag takes into account all of the accessors within the property, but one of the accessors has limited access.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RemoveRegionSA1123
- Do not place regions within elements
- The C# code contains a region within the body of a code element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RemoveRegionSA1124
- Do not use regions
- The C# code contains a region.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1306
- Field names should begin with lower-case letter
- The name of a field in C# does not begin with a lower-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1312
- Variable names should begin with lower-case letter
- The name of a variable in C# does not begin with a lower-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1313
- Parameter names should begin with lower-case letter
- The name of a parameter in C# does not begin with a lower-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1300
- Element should begin with upper-case letter
- The name of a C# element does not begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1303
- Const field names should begin with upper-case letter
- The name of a constant C# field should begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1304
- Non-private readonly fields should begin with upper-case letter
- The name of a non-private readonly C# field should being with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1307
- Accessible fields should begin with upper-case letter
- The name of a public or internal field in C# does not begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1311
- Static readonly fields should begin with upper-case letter
- The name of a static readonly field does not begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1003SA1003
- Symbols should be spaced correctly
- The spacing around an operator symbol is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1004SA1004
- Documentation lines should begin with single space
- A line within a documentation header above a C# element does not begin with a single space.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1005SA1005
- Single line comments should begin with single space
- A single-line comment within a C# code file does not begin with a single space.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1018SA1018
- Nullable type symbols should be spaced correctly
- A nullable type symbol within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1025SA1025
- Code should not contain multiple whitespace in a row
- The code contains multiple whitespace characters in a row.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1027SA1027
- Use tabs correctly
- The code contains a tab or space character which is not consistent with the current project settings.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1028SA1028
- Code should not contain trailing whitespace
- There should not be any whitespace at the end of a line of code.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1100SA1100
- Do not prefix calls with base unless local implementation exists
- A call to a member from an inherited class begins with 'base.', and the local class does not contain an override or implementation of the member.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1101SA1101
- Prefix local calls with this
- A call to an instance member of the local class or a base class is not prefixed with 'this.', within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1102SA1102
- Query clause should follow previous clause
- A C# query clause does not begin on the same line as the previous clause, or on the next line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1103SA1103
- Query clauses should be on separate lines or all on one line
- The clauses within a C# query expression are not all placed on the same line, and each clause is not placed on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1104SA1105SA1104
- Query clause should begin on new line when previous clause spans multiple lines
- A clause within a C# query expression begins on the same line as the previous clause, when the previous clause spans across multiple lines.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1104SA1105SA1105
- Query clauses spanning multiple lines should begin on own line
- A clause within a C# query expression spans across multiple lines, and does not begin on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1106SA1106
- Code should not contain empty statements
- The C# code contains an extra semicolon.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1107SA1107
- Code should not contain multiple statements on one line
- The C# code contains more than one statement on a single line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1116SA1116
- Split parameters should start on line after declaration
- The parameters to a C# method or indexer call or declaration span across multiple lines, but the first parameter does not start on the line after the opening bracket.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1119SA1119
- Statement should not use unnecessary parenthesis
- A C# statement contains parenthesis which are unnecessary and should be removed.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1119SA1119_p
- Statement should not use unnecessary parenthesis
- A C# statement contains parenthesis which are unnecessary and should be removed.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1120SA1120
- Comments should contain text
- The C# comment does not contain any comment text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1121SA1121
- Use built-in type alias
- The code uses one of the basic C# types, but does not use the built-in alias for the type.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1122SA1122
- Use string.Empty for empty strings
- The C# code includes an empty string, written as "".
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1127SA1127
- Generic type constraints should be on their own line
- Each type constraint clause for a generic type parameter should be listed on a line of code by itself.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1128SA1128
- Put constructor initializers on their own line
- A constructor initializer, including the colon character, should be on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1129SA1129
- Do not use default value type constructor
- When creating a new instance of a value type T, the syntax 'default(T)' is functionally equivalent to the syntax 'new T()'. To avoid confusion regarding the behavior of the resulting instance, the first form is preferred.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1130SA1130
- Use lambda syntax
- Lambda expressions are more succinct and easier to read than anonymous methods, so they should are preferred whenever the two are functionally equivalent.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1131SA1131
- Use readable conditions
- When a comparison is made between a variable and a literal, the variable should be placed on the left-hand-side to maximize readability.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1132SA1132
- Do not combine fields
- Each field should be declared on its own line, in order to clearly see each field of a type and allow for proper documentation of the behavior of each field.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1133SA1133
- Do not combine attributes
- Each attribute usage should be placed in its own set of square brackets for maximum readability.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1134SA1134
- Attributes should not share line
- Each attribute should be placed on its own line of code.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1135SA1135
- Using directives should be qualified
- All using directives should be qualified.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1136SA1136
- Enum values should be on separate lines
- Enum values should be placed on their own lines for maximum readability.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1139SA1139
- Use literal suffix notation instead of casting
- Use literal suffix notation instead of casting, in order to improve readability, avoid bugs related to illegal casts and ensure that optimal IL is produced.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1205SA1205
- Partial elements should declare access
- The partial element does not have an access modifier defined.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1206SA1206
- Declaration keywords should follow order
- The keywords within the declaration of an element do not follow a standard ordering scheme.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1207SA1207
- Protected should come before internal
- The keyword '0' is positioned after the keyword '1' within the declaration of a 0 1 C# element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1212SA1213SA1212
- Property accessors should follow order
- A get accessor appears after a set accessor within a property or indexer.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1212SA1213SA1213
- Event accessors should follow order
- An add accessor appears after a remove accessor within an event.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1302SA1302
- Interface names should begin with I
- The name of a C# interface does not begin with the capital letter I.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1308SA1308
- Variable names should not be prefixed
- A field name in C# is prefixed with 'm_', 's_', or 't_'.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1309SA1309
- Field names should not begin with underscore
- A field name in C# begins with an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1310SA1310
- Field names should not contain underscore
- A field name in C# contains an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1314SA1314
- Type parameter names should begin with T
- The name of a C# type parameter does not begin with the capital letter T.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1400SA1400
- Access modifier should be declared
- The access modifier for a C# element has not been explicitly defined.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1402SA1402
- File may only contain a single type
- A C# code file contains more than one unique type.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1404SA1404
- Code analysis suppression should have justification
- A Code Analysis SuppressMessage attribute does not include a justification.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1407SA1408SA1407
- Arithmetic expressions should declare precedence
- A C# statement contains a complex arithmetic expression which omits parenthesis around operators.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1407SA1408SA1408
- Conditional expressions should declare precedence
- A C# statement contains a complex conditional expression which omits parenthesis around operators.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1410SA1411SA1410
- Remove delegate parenthesis when possible
- A call to a C# anonymous method does not contain any method parameters, yet the statement still includes parenthesis.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1410SA1411SA1411
- Attribute constructor should not use unnecessary parenthesis
- TODO.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1412SA1412
- Store files as UTF-8 with byte order mark
- Source files should be saved using the UTF-8 encoding with a byte order mark
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1413SA1413
- Use trailing comma in multi-line initializers
- A multi-line initializer in a C# code file should use a comma on the last line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1500SA1500
- Braces for multi-line statements should not share line
- The opening or closing brace within a C# statement, element, or expression is not placed on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1501SA1501
- Statement should not be on a single line
- A C# statement containing opening and closing braces is written completely on a single line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1502SA1502
- Element should not be on a single line
- A C# element containing opening and closing braces is written completely on a single line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1503
- Braces should not be omitted
- The opening and closing braces for a C# statement have been omitted.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1519
- Braces should not be omitted from multi-line child statement
- The opening and closing braces for a multi-line C# statement have been omitted.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1520
- Use braces consistently
- The opening and closing braces of a chained if/else if/else construct were included for some clauses, but omitted for others.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1504SA1504
- All accessors should be single-line or multi-line
- Within a C# property, indexer or event, at least one of the child accessors is written on a single line, and at least one of the child accessors is written across multiple lines.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1505SA1505
- Opening braces should not be followed by blank line
- An opening brace within a C# element, statement, or expression is followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1506SA1506
- Element documentation headers should not be followed by blank line
- An element documentation header above a C# element is followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1507SA1507
- Code should not contain multiple blank lines in a row
- The C# code contains multiple blank lines in a row.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1508SA1508
- Closing braces should not be preceded by blank line
- A closing brace within a C# element, statement, or expression is preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1509SA1509
- Opening braces should not be preceded by blank line
- An opening brace within a C# element, statement, or expression is preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1510SA1510
- Chained statement blocks should not be preceded by blank line
- Chained C# statements are separated by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1511SA1511
- While-do footer should not be preceded by blank line
- The while footer at the bottom of a do-while statement is separated from the statement by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1512SA1512
- Single-line comments should not be followed by blank line
- A single-line comment within C# code is followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1513SA1513
- Closing brace should be followed by blank line
- A closing brace within a C# element, statement, or expression is not followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1514SA1514
- Element documentation header should be preceded by blank line
- An element documentation header above a C# element is not preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1515SA1515
- Single-line comment should be preceded by blank line
- A single-line comment within C# code is not preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1516SA1516
- Elements should be separated by blank line
- Adjacent C# elements are not separated by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1517SA1517
- Code should not contain blank lines at start of file
- The code file has blank lines at the start.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1518SA1518
- Use line endings correctly at end of file
- Code should not contain blank lines at the end of the file
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1609SA1610SA1609
- Property documentation should have value
- The XML header documentation for a C# property does not contain a <value> tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1609SA1610SA1610
- Property documentation should have value text
- The XML header documentation for a C# property contains an empty <value> tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1615SA1616SA1615
- Element return value should be documented
- A C# element is missing documentation for its return value.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1615SA1616SA1616
- Element return value documentation should have text
- The <returns> tag within a C# element's documentation header is empty.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1617SA1617
- Void return value should not be documented
- A C# code element does not contain a return value, or returns void, but the documentation header for the element contains a <returns> tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1626SA1626
- Single-line comments should not use documentation style slashes
- The C# code contains a single-line comment which begins with three forward slashes in a row.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1629SA1629
- Documentation text should end with a period
- A section of the XML header documentation for a C# element does not end with a period.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1642SA1643SA1642
- Constructor summary documentation should begin with standard text
- The XML documentation header for a C# constructor does not contain the appropriate summary text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1642SA1643SA1643
- Destructor summary documentation should begin with standard text
- The XML documentation header for a C# finalizer does not contain the appropriate summary text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1651SA1651
- Do not use placeholder elements
- The element documentation contains a <placeholder> element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SX1101SX1101
- Do not prefix local calls with 'this.'
- A call to an instance member of the local class or a base class is prefixed with
this..
- org.openrewrite.csharp.recipes.stylecop.analyzers.SX1309SX1309
- Field names should begin with underscore
- A field name in C# does not begin with an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SX1309SX1309S
- Static field names should begin with underscore
- A static field name in C# does not begin with an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1600
- Elements should be documented
- A C# code element is missing a documentation header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1601
- Partial elements should be documented
- A C# partial element is missing a documentation header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1602
- Enumeration items should be documented
- An item within a C# enumeration is missing an Xml documentation header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1633
- File should have header
- A C# code file is missing a standard file header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1634
- File header should show copyright
- The file header at the top of a C# code file is missing a copyright tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1635
- File header should have copyright text
- The file header at the top of a C# code file is missing copyright text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1636
- File header copyright text should match
- The file header at the top of a C# code file does not contain the appropriate copyright text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1637
- File header should contain file name
- The file header at the top of a C# code file is missing the file name.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1638
- File header file name documentation should match file name
- The file attribute within copyright tag of the file header at the top of a C# code file does not contain the name of the file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1639
- File header should have summary
- The file header at the top of a C# code file does not contain a filled-in summary tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1640
- File header should have valid company text
- The file header at the top of a C# code file does not contain company name text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1641
- File header company name text should match
- The file header at the top of a C# code file does not contain the appropriate company name text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1649
- File name should match first type name
- The file name of a C# code file does not match the first type declared in the file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1000
- Keywords should be spaced correctly
- The spacing around a C# keyword is incorrect.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1001
- Commas should be spaced correctly
- The spacing around a comma is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1002
- Semicolons should be spaced correctly
- The spacing around a semicolon is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1006
- Preprocessor keywords should not be preceded by space
- A C# preprocessor-type keyword is preceded by space.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1007
- Operator keyword should be followed by space
- The operator keyword within a C# operator overload method is not followed by any whitespace.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1008
- Opening parenthesis should be spaced correctly
- An opening parenthesis within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1009
- Closing parenthesis should be spaced correctly
- A closing parenthesis within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1010
- Opening square brackets should be spaced correctly
- An opening square bracket within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1011
- Closing square brackets should be spaced correctly
- A closing square bracket within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1012
- Opening braces should be spaced correctly
- An opening brace within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1013
- Closing braces should be spaced correctly
- A closing brace within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1014
- Opening generic brackets should be spaced correctly
- An opening generic bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1015
- Closing generic brackets should be spaced correctly
- A closing generic bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1016
- Opening attribute brackets should be spaced correctly
- An opening attribute bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1017
- Closing attribute brackets should be spaced correctly
- A closing attribute bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1019
- Member access symbols should be spaced correctly
- The spacing around a member access symbol is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1020
- Increment decrement symbols should be spaced correctly
- An increment or decrement symbol within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1021
- Negative signs should be spaced correctly
- A negative sign within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1022
- Positive signs should be spaced correctly
- A positive sign within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1023
- Dereference and access of symbols should be spaced correctly
- A dereference symbol or an access-of symbol within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1024
- Colons Should Be Spaced Correctly
- A colon within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1026
- Code should not contain space after new or stackalloc keyword in implicitly typed array allocation
- An implicitly typed array allocation within a C# code file is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1110
- Opening parenthesis or bracket should be on declaration line
- The opening parenthesis or bracket is not placed on the same line as the method/indexer/attribute/array name.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1111
- Closing parenthesis should be on line of last parameter
- The closing parenthesis or bracket in a call to or declaration of a C# method/indexer/attribute/array/constructor/delegate is not placed on the same line as the last parameter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1112
- Closing parenthesis should be on line of opening parenthesis
- The closing parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the same line as the opening bracket when the element does not take any parameters.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1113
- Comma should be on the same line as previous parameter
- A comma between two parameters in a call to a C# method or indexer, or in the declaration of a method or indexer, is not placed on the same line as the previous parameter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1200
- Using directives should be placed correctly
- A C# using directive is placed outside of a namespace element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1208
- System using directives should be placed before other using directives
- A using directive which declares a member of the 'System' namespace appears after a using directive which declares a member of a different namespace, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1209
- Using alias directives should be placed after other using directives
- A using-alias directive is positioned before a regular using directive.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1210
- Using directives should be ordered alphabetically by namespace
- The using directives within a C# code file are not sorted alphabetically by namespace.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1211
- Using alias directives should be ordered alphabetically by alias name
- The using-alias directives within a C# code file are not sorted alphabetically by alias name.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1216
- Using static directives should be placed at the correct location.
- A using static directive is positioned before a regular or after an alias using directive.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1217
- Using static directives should be ordered alphabetically
- All using static directives should be ordered alphabetically.
- org.openrewrite.csharp.recipes.wpfanalyzers.AddAttributeListFixWPF0130
- Add [TemplatePart] to the type
- Add [TemplatePart] to the type.
- org.openrewrite.csharp.recipes.wpfanalyzers.AddAttributeListFixWPF0176
- StyleTypedProperty is missing
- StyleTypedProperty is missing.
- org.openrewrite.csharp.recipes.wpfanalyzers.AddDefaultMemberFixWPF0070
- Add default field to converter
- Add default field to converter.
- org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeArgumentFixWPF0034
- Use correct argument for [AttachedPropertyBrowsableForType]
- Use correct argument for [AttachedPropertyBrowsableForType].
- org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeAttributeFixWPF0033
- Add [AttachedPropertyBrowsableForType]
- Add [AttachedPropertyBrowsableForType].
- org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeAttributeFixWPF0071
- Add ValueConversion attribute
- Add ValueConversion attribute.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0019
- Cast sender to correct type
- Cast sender to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0020
- Cast value to correct type
- Cast value to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0021
- Cast sender to containing type
- Cast sender to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0022
- Cast value to correct type
- Cast value to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.ChangeTypeofFixWPF0081
- MarkupExtensionReturnType must use correct return type
- MarkupExtensionReturnType must use correct return type.
- org.openrewrite.csharp.recipes.wpfanalyzers.ComponentResourceKeyFixWPF0140
- Use containing type when creating a ComponentResourceKey
- Use containing type when creating a ComponentResourceKey.
- org.openrewrite.csharp.recipes.wpfanalyzers.ComponentResourceKeyFixWPF0141
- Use containing member as key when creating a ComponentResourceKey
- Use containing member as key when creating a ComponentResourceKey.
- org.openrewrite.csharp.recipes.wpfanalyzers.ConstructorArgumentAttributeArgumentFixWPF0082
- [ConstructorArgument] must match
- [ConstructorArgument] must match the name of the constructor parameter.
- org.openrewrite.csharp.recipes.wpfanalyzers.ConstructorArgumentAttributeFixWPF0083
- Add [ConstructorArgument]
- Add [ConstructorArgument] for the property.
- org.openrewrite.csharp.recipes.wpfanalyzers.ConvertToLambdaFixWPF0023
- The callback is trivial, convert to lambda
- The callback is trivial, convert to lambda for better locality.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0060
- Backing member for DependencyProperty should have standard documentation text
- Backing member for DependencyProperty should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0061
- Accessor method for attached property should have standard documentation text
- Accessor method for attached property should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0062
- Property changed callback should have standard documentation text
- Property changed callback should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0108
- Backing member for RoutedEvent should have standard documentation text
- Backing member for RoutedEvent should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0030
- Backing field for a DependencyProperty should be static and readonly
- Backing field for a DependencyProperty should be static and readonly.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0107
- Backing member for a RoutedEvent should be static and readonly
- Backing member for a RoutedEvent should be static and readonly.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0123
- Backing field for a RoutedCommand should be static and readonly
- Backing field for a RoutedCommand should be static and readonly.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeNullableFixWPF0024
- Parameter type should be nullable
- Parameter type should be nullable.
- org.openrewrite.csharp.recipes.wpfanalyzers.MarkupExtensionReturnTypeAttributeFixWPF0080
- Add MarkupExtensionReturnType attribute
- Add MarkupExtensionReturnType attribute.
- org.openrewrite.csharp.recipes.wpfanalyzers.MoveFixWPF0031
- DependencyPropertyKey member must be declared before DependencyProperty member
- DependencyPropertyKey member must be declared before DependencyProperty member.
- org.openrewrite.csharp.recipes.wpfanalyzers.RegisterRoutedCommandFixWPF0122
- Register name and owning type for routed command
- Register containing type as owner for routed command.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0001
- Backing field for a DependencyProperty should match registered name
- A dependency property's backing field should be named with the name it is registered with suffixed by 'Property'. This is the convention in the framework.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0002
- Backing field for a DependencyPropertyKey should match registered name
- A DependencyPropertyKey's backing field must be named with the name it is registered with suffixed by 'PropertyKey'.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0003
- CLR property for a DependencyProperty should match registered name
- A CLR property accessor for a DependencyProperty must have the same name as the DependencyProperty is registered with.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0004
- CLR method for a DependencyProperty must match registered name
- CLR methods for accessing a DependencyProperty must have names matching the name the DependencyProperty is registered with.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0005
- Name of PropertyChangedCallback should match registered name
- Name of PropertyChangedCallback should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0006
- Name of CoerceValueCallback should match registered name
- Name of CoerceValueCallback should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0007
- Name of ValidateValueCallback should match registered name
- Name of ValidateValueCallback should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0090
- Name the invoked method OnEventName
- Name the invoked method OnEventName.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0091
- Name the invoked method OnEventName
- Name the invoked method OnEventName.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0100
- Backing field for a RoutedEvent should match registered name
- A routed event's backing field should be named with the name it is registered with suffixed by 'Event'.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0102
- Name of the event should match registered name
- Name of the event should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0011
- Containing type should be used as registered owner
- When registering a DependencyProperty register containing type as owner type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0101
- Containing type should be used as registered owner
- When registering a RoutedEvent register containing type as owner type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0121
- Register containing type as owner for routed command
- Register containing type as owner for routed command.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseCorrectDelegateFixWPF0092
- Use correct handler type
- Use correct handler type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseDependencyPropertyKeyFixWPF0040
- A readonly DependencyProperty must be set with DependencyPropertyKey
- A readonly DependencyProperty must be set with DependencyPropertyKey.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0120
- Register containing member name as name for routed command
- Register containing member name as name for routed command.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0150
- Use nameof() instead of literal
- Use nameof() as it is less fragile than string literal.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0151
- Use nameof() instead of constant
- Use nameof() as it is less fragile than constant.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseRegisteredTypeFixWPF0012
- CLR property type should match registered type
- CLR property type should match registered type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseRegisteredTypeFixWPF0013
- CLR accessor for attached property must match registered type
- CLR accessor for attached property must match registered type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseSetCurrentValueFixWPF0041
- Set mutable dependency properties using SetCurrentValue
- Prefer setting mutable dependency properties using SetCurrentValue.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseSetValueFixWPF0035
- Use SetValue in setter
- Use SetValue in setter.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseSetValueFixWPF0043
- Don't set DataContext and Style using SetCurrentValue
- Set DataContext and Style using SetValue.
- org.openrewrite.csharp.recipes.wpfanalyzers.ValueConversionAttributeArgumentFixWPF0072
- ValueConversion must use correct types
- ValueConversion must use correct types.
- org.openrewrite.csharp.recipes.wpfanalyzers.ValueConversionAttributeFixWPF0073
- Add ValueConversion attribute (unknown types)
- Add ValueConversion attribute (unknown types).
- org.openrewrite.csharp.recipes.wpfanalyzers.XmlnsDefinitionFixWPF0052
- XmlnsDefinitions does not map all namespaces with public types
- XmlnsDefinitions does not map all namespaces with public types.
rewrite-docker
- org.openrewrite.docker.search.FindDockerImageUses
- Find uses of docker base images
- Produce an impact analysis of base images used in Dockerfiles, .gitlab-ci files, Kubernetes Deployment file, etc.
rewrite-dotnet
- org.openrewrite.dotnet.UpgradeAssistantAnalyze
- Analyze a .NET project using upgrade-assistant
- Run upgrade-assistant analyze across a repository to analyze changes required to upgrade projects to a newer version of .NET. This recipe will generate an
org.openrewrite.dotnet.UpgradeAssistantAnalysisdata table containing the report details.
rewrite-dropwizard
- org.openrewrite.java.dropwizard.method.RemoveUnnecessarySuperCalls
- Remove
supercalls when the class does not extend another class - Removes calls to
super(...)orsuper.someMethod(...)if the class does not have a real superclass besidesjava.lang.Object.
- Remove
rewrite-feature-flags
- org.openrewrite.featureflags.ff4j.RemoveCheck
- Remove FF4j's
checkfor feature key - Replace
check()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove FF4j's
- org.openrewrite.featureflags.ff4j.search.FindFeatureFlag
- Find a FF4j feature flag
- Find a FF4j feature flag.
- org.openrewrite.featureflags.launchdarkly.ChangeVariationDefault
- Change the default value for feature key
- Change the default value for
Variationinvocations for feature key.
- org.openrewrite.featureflags.launchdarkly.RemoveBoolVariation
- Remove LaunchDarkly's
boolVariationfor feature key - Replace
boolVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveDoubleVariation
- Remove LaunchDarkly's
doubleVariationfor feature key - Replace
doubleVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveIntVariation
- Remove LaunchDarkly's
intVariationfor feature key - Replace
intVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveStringVariation
- Remove LaunchDarkly's
boolVariationfor feature key - Replace
boolVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.search.FindFeatureFlag
- Find a LaunchDarkly feature flag
- Find a LaunchDarkly feature flag.
- org.openrewrite.featureflags.openfeature.RemoveGetBooleanValue
- Remove OpenFeature's
getBooleanValuefor feature key - Replace
getBooleanValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetDoubleValue
- Remove OpenFeature's
getDoubleValuefor feature key - Replace
getDoubleValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetIntegerValue
- Remove OpenFeature's
getIntegerValuefor feature key - Replace
getIntegerValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetStringValue
- Remove OpenFeature's
getStringValuefor feature key - Replace
getStringValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.search.FindFeatureFlag
- Find an OpenFeature feature flag
- Find an OpenFeature feature flag.
- org.openrewrite.featureflags.quarkus.RemoveGetInt
- Remove Quarkus feature flag's
getIntfor feature key - Replace
getInt()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.RemoveGetString
- Remove Quarkus feature flag's
getStringfor feature key - Replace
getString()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.RemoveIsEnabled
- Remove Quarkus feature flag's
isEnabledfor feature key - Replace
isEnabled()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.search.FindFeatureFlag
- Find a Quarkus feature flag
- Find a Quarkus feature flag.
- org.openrewrite.featureflags.unleash.RemoveIsEnabled
- Remove Unleash's
isEnabledfor feature key - Replace
isEnabled()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Unleash's
- org.openrewrite.featureflags.unleash.search.FindFeatureFlag
- Find an Unleash feature flag
- Find an Unleash feature flag.
rewrite-github-actions
- org.openrewrite.github.AddCronTrigger
- Add cron workflow trigger
- The
scheduleevent allows you to trigger a workflow at a scheduled time.
- org.openrewrite.github.AddDependabotCooldown
- Add cooldown periods to Dependabot configuration
- Adds a
cooldownsection to each update configuration in Dependabot files. Supportsdefault-days,semver-major-days,semver-minor-days,semver-patch-days,include, andexcludeoptions. This implements a security best practice where dependencies are not immediately adopted upon release, allowing time for security vendors to identify potential supply chain compromises. Cooldown applies only to version updates, not security updates. Read more about dependency cooldowns. The available configuration options for dependabot are listed on GitHub.
- org.openrewrite.github.AutoCancelInProgressWorkflow
- Cancel in-progress workflow when it is triggered again
- When a workflow is already running and would be triggered again, cancel the existing workflow. See
styfle/cancel-workflow-actionfor details.
- org.openrewrite.github.FindMissingTimeout
- Find jobs missing timeout
- Find GitHub Actions jobs missing a timeout.
- org.openrewrite.github.IsGitHubActionsWorkflow
- Is GitHub Actions Workflow
- Checks if the file is a GitHub Actions workflow file.
- org.openrewrite.github.PreferSecretsInheritWorkflow
- Use
secrets: inheritif possible - Pass all secrets to a reusable workflow using
secrets: inherit. See Simplify using secrets with reusable workflows for details.
- Use
- org.openrewrite.github.PreferTemurinDistributions
- Use
actions/setup-javatemurindistribution as they are cached in hosted runners - Host runners include Temurin by default as part of the hosted tool cache. Using Temurin speeds up builds as there is no need to download and configure the Java SDK with every build.
- Use
- org.openrewrite.github.RemoveAllCronTriggers
- Remove all cron triggers
- Removes all cron triggers from a workflow.
- org.openrewrite.github.RemoveUnusedWorkflowDispatchInputs
- Remove unused workflow dispatch inputs
- Remove workflow_dispatch inputs that are not referenced anywhere in the workflow file.
- org.openrewrite.github.RemoveWorkflowInputArgument
- Remove workflow input argument
- Remove a specific input argument from calls to a reusable workflow.
- org.openrewrite.github.ReplaceRunners
- Replace runners for a job
- Replaces the runners of a given job.
- org.openrewrite.github.SetupJavaAdoptOpenJDKToTemurin
- Use
actions/setup-javatemurindistribution - Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt to temurin to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.
- Use
- org.openrewrite.github.SetupJavaAdoptOpenj9ToSemeru
- Use
actions/setup-javaIBMsemerudistribution - Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt-openj9 to IBM semeru to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.
- Use
- org.openrewrite.github.SetupJavaCaching
- Setup Java dependency caching
- GitHub actions supports dependency caching on Maven and Gradle projects. See the blog post.
- org.openrewrite.github.SetupNodeUpgradeNodeVersion
- Upgrade
actions/setup-nodenode-version - Update the Node.js version used by
actions/setup-nodeif it is below the expected version number.
- Upgrade
- org.openrewrite.github.SetupPythonToUv
- Replace
actions/setup-pythonwithastral-sh/setup-uv - Replace
actions/setup-pythonaction withastral-sh/setup-uvaction for faster Python environment setup and dependency management. Benefits of UV: - Significantly faster package installation and environment setup - Built-in dependency resolution and locking - Integrated caching for improved CI performance - Drop-in replacement for pip workflows Transformations applied: -actions/setup-python@v5→astral-sh/setup-uv@v6-cache: 'pip'→enable-cache: 'true'-pip install -r requirements.txt→uv sync(configurable strategy) -python -m <module>→uv run <module>- Removes unnecessarypip install --upgrade pipsteps Sync strategies: -basic: Basic synchronization (uv sync) -locked: Use locked dependencies (uv sync --locked) -full: Install all extras and dev dependencies (uv sync --all-extras --dev) See the UV GitHub integration guide for more details.
- Replace
- org.openrewrite.github.UpgradeSlackNotificationVersion2
- Upgrade
slackapi/slack-github-action - Update the Slack GitHub Action to use version 2.0.
- Upgrade
- org.openrewrite.github.security.AnonymousJobsRecipe
- Find jobs without descriptive names
- Find jobs that lack descriptive names, making them harder to identify in workflow runs. Jobs without
nameproperties default to their job ID, which may not be descriptive. Based on zizmor's anonymous-definition audit.
rewrite-gitlab
- org.openrewrite.gitlab.AddComponent
- Add GitLab component
- Add a GitLab component to an existing list, or add a new list where none was present.
- org.openrewrite.gitlab.AddStages
- Add GitLab stages
- Add or Update the set of stages defined in
.gitlab-ci.yml.
- org.openrewrite.gitlab.AddTemplate
- Add GitLab template
- Add a GitLab template to an existing list, or add a new list where none was present.
- org.openrewrite.gitlab.ChangeComponent
- Change GitLab Component
- Change a GitLab Component in use.
- org.openrewrite.gitlab.ChangeTemplate
- Change GitLab template
- Change a GitLab template in use.
- org.openrewrite.gitlab.RemoveTemplate
- Remove GitLab template
- Remove a GitLab template from use.
- org.openrewrite.gitlab.search.FindComponent
- Find GitLab Component
- Find a GitLab Component in use.
- org.openrewrite.gitlab.search.FindTemplate
- Find GitLab Template
- Find a GitLab Template in use.
rewrite-gradle
- org.openrewrite.gradle.AddPlatformDependency
- Add Gradle platform dependency
- Add a gradle platform dependency to a
build.gradlefile in the correct configuration based on where it is used.
- org.openrewrite.gradle.ChangeDependency
- Change Gradle dependency
- Change a Gradle dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before.
- org.openrewrite.gradle.ChangeDependencyArtifactId
- Change Gradle dependency artifact
- Change the artifact of a specified Gradle dependency.
- org.openrewrite.gradle.ChangeDependencyExtension
- Change a Gradle dependency extension
- Changes extension of an existing dependency declared in
build.gradlefiles.
- org.openrewrite.gradle.ChangeExtraProperty
- Change Extra Property
- Gradle's ExtraPropertiesExtension is a commonly used mechanism for setting arbitrary key/value pairs on a project. This recipe will change the value of a property with the given key name if that key can be found. It assumes that the value being set is a String literal. Does not add the value if it does not already exist.
- org.openrewrite.gradle.ChangeManagedDependency
- Change Gradle managed dependency
- Change a Gradle managed dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before. For now, only Spring Dependency Management Plugin entries are supported and no other forms of managed dependencies (yet).
- org.openrewrite.gradle.DependencyConstraintToRule
- Dependency constraint to resolution rule
- Gradle dependency constraints are useful for managing the versions of transitive dependencies. Some plugins, such as the Spring Dependency Management plugin, do not respect these constraints. This recipe converts constraints into resolution rules, which can achieve similar effects to constraints but are harder for plugins to ignore.
- org.openrewrite.gradle.DependencyUseMapNotation
- Use
Mapnotation for Gradle dependency declarations - In Gradle, dependencies can be expressed as a
Stringlike"groupId:artifactId:version", or equivalently as aMaplikegroup: 'groupId', name: 'artifactId', version: 'version'(groovy) orgroup = "groupId", name = "artifactId", version = "version"(kotlin). This recipe replaces dependencies represented asStringswith an equivalent dependency represented as aMap.
- Use
- org.openrewrite.gradle.EnableDevelocityBuildCache
- Enable Develocity build cache
- Adds
buildCacheconfiguration todevelocitywhere not yet present.
- org.openrewrite.gradle.MigrateDependenciesToVersionCatalog
- Migrate Gradle project dependencies to version catalog
- Migrates Gradle project dependencies to use the version catalog feature. Supports migrating dependency declarations of various forms: *
Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'* Property references:"group:artifact:$version"or"group:artifact:${version}"The recipe will: * Create agradle/libs.versions.tomlfile with version declarations * Replace dependency declarations with catalog references (e.g.,libs.springCore) * Migrate version properties fromgradle.propertiesto the version catalog * Preserve project dependencies unchanged Note: If a version catalog already exists, the recipe will not modify it.
- org.openrewrite.gradle.RemoveDependency
- Remove a Gradle dependency
- Removes a single dependency from the dependencies section of the
build.gradle.
- org.openrewrite.gradle.RemoveRedundantDependencyVersions
- Remove redundant explicit dependencies and versions
- Remove explicitly-specified dependency versions that are managed by a Gradle
platform,enforcedPlatformor theio.spring.dependency-managementplugin. Also removes redundant direct dependencies and dependency constraints that are already satisfied by transitive dependencies.
- org.openrewrite.gradle.RemoveRedundantSecurityResolutionRules
- Remove redundant security resolution rules
- Remove
resolutionStrategy.eachDependencyrules that pin dependencies to versions that are already being managed by a platform/BOM to equal or newer versions. Only removes rules that have a security advisory identifier (CVE or GHSA) in thebecauseclause, unless a custom pattern is specified.
- org.openrewrite.gradle.RemoveRepository
- Remove repository
- Removes a repository from Gradle build scripts. Named repositories include "jcenter", "mavenCentral", "mavenLocal", and "google".
- org.openrewrite.gradle.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle dependencies
- Upgrades the version of a transitive dependency in a Gradle build file. There are many ways to do this in Gradle, so the mechanism for upgrading a transitive dependency must be considered carefully depending on your style of dependency management.
- org.openrewrite.gradle.plugins.AddBuildPlugin
- Add Gradle plugin
- Add a build plugin to a Gradle build file's
pluginsblock.
- org.openrewrite.gradle.plugins.AddDevelocityGradlePlugin
- Add the Develocity Gradle plugin
- Add the Develocity Gradle plugin to settings.gradle files.
- org.openrewrite.gradle.plugins.AddSettingsPlugin
- Add Gradle settings plugin
- Add plugin to Gradle settings file
pluginsblock by id.
- org.openrewrite.gradle.plugins.AddSettingsPluginRepository
- Add a Gradle settings repository
- Add a Gradle settings repository to
settings.gradle(.kts).
- org.openrewrite.gradle.plugins.ChangePlugin
- Change a Gradle plugin
- Changes the selected Gradle plugin to the new plugin.
- org.openrewrite.gradle.plugins.MigrateGradleEnterpriseToDevelocity
- Migrate from Gradle Enterprise to Develocity
- Migrate from the Gradle Enterprise Gradle plugin to the Develocity Gradle plugin.
- org.openrewrite.gradle.search.DoesNotIncludeDependency
- Does not include Gradle dependency
- A precondition which returns false if visiting a Gradle file which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.gradle.search.EffectiveGradlePluginRepositories
- List effective Gradle plugin repositories
- Lists the Gradle plugin repositories that would be used for plugin resolution, in order of precedence. This includes Maven repositories defined in the settings.gradle pluginManagement section and build.gradle buildscript repositories as determined when the LST was produced.
- org.openrewrite.gradle.search.EffectiveGradleRepositories
- List effective Gradle project repositories
- Lists the Gradle project repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Gradle build files and settings as determined when the LST was produced.
- org.openrewrite.gradle.search.FindDependency
- Find Gradle dependency
- Finds dependencies declared in gradle build files. See the reference on Gradle configurations or the diagram below for a description of what configuration to use. A project's compile and runtime classpath is based on these configurations. <img alt="Gradle compile classpath" src="https://docs.gradle.org/current/userguide/img/java-library-ignore-deprecated-main.png" width="200px"/> A project's test classpath is based on these configurations. <img alt="Gradle test classpath" src="https://docs.gradle.org/current/userguide/img/java-library-ignore-deprecated-test.png" width="200px"/>.
- org.openrewrite.gradle.search.FindDependencyHandler
- Find Gradle
dependenciesblocks - Find the dependency handler containing any number of dependency definitions.
- Find Gradle
- org.openrewrite.gradle.search.FindGradleProject
- Find Gradle projects
- Gradle projects are those with
build.gradleorbuild.gradle.ktsfiles.
- org.openrewrite.gradle.search.FindGradleWrapper
- Find Gradle wrappers
- Find Gradle wrappers.
- org.openrewrite.gradle.search.FindJVMTestSuites
- Find Gradle JVMTestSuite plugin configuration
- Find Gradle JVMTestSuite plugin configurations and produce a data table.
- org.openrewrite.gradle.search.FindPlugins
- Find Gradle plugin
- Find a Gradle plugin by id and/or class name. For best results both should be specified, as one cannot automatically be used to infer the other.
- org.openrewrite.gradle.search.FindRepository
- Find Gradle repository
- Find a Gradle repository by url.
- org.openrewrite.gradle.search.ModuleHasDependency
- Module has dependency
- Searches for Gradle Projects (modules) that have a dependency matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file that use the dependency, use theFindDependencyrecipe instead.
- org.openrewrite.gradle.search.ModuleHasPlugin
- Module has plugin
- Searches for Gradle Projects (modules) that have a plugin matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring dependency management plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
- org.openrewrite.gradle.security.UseHttpsForRepositories
- Use HTTPS for repositories
- Use HTTPS for repository URLs.
rewrite-groovy
- org.openrewrite.groovy.format.AutoFormat
- Format Groovy code
- Format Groovy code using a standard comprehensive set of Groovy formatting recipes.
- org.openrewrite.groovy.format.GStringCurlyBraces
- Groovy GString curly braces
- In Groovy GStrings, curly braces are optional for single variable expressions. This recipe adds them, so that the expression is always surrounded by curly braces.
- org.openrewrite.groovy.format.OmitParenthesesForLastArgumentLambda
- Move a closure which is the last argument of a method invocation out of parentheses
- Groovy allows a shorthand syntax that allows a closure to be placed outside of parentheses.
- org.openrewrite.groovy.format.OmitParenthesesFormat
- Stylize Groovy code to omit parentheses
- Omit parentheses for last argument lambdas in Groovy code.
rewrite-hcl
- org.openrewrite.hcl.DeleteContent
- Delete content
- Delete HCL content by path.
- org.openrewrite.hcl.MoveContentToFile
- Move content to another file
- Move content to another HCL file, deleting it in the original file.
- org.openrewrite.hcl.ReplaceLegacyAttributeIndexSyntax
- Replace legacy attribute index syntax
- Replace legacy attribute index syntax (
.0) with the new syntax ([0]).
- org.openrewrite.hcl.format.AutoFormat
- Format HCL code
- Format HCL code using a standard comprehensive set of HCL formatting recipes.
- org.openrewrite.hcl.format.BlankLines
- Blank lines
- Add and/or remove blank lines.
- org.openrewrite.hcl.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.hcl.format.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.hcl.format.Spaces
- Spaces
- Format whitespace in HCL code.
- org.openrewrite.hcl.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in HCL code.
- org.openrewrite.hcl.search.FindAndReplaceLiteral
- Find and replace literals in HCL files
- Find and replace literal values in HCL files. This recipe parses the source files on which it runs as HCL, meaning you can execute HCL language-specific recipes before and after this recipe in a single recipe run.
- org.openrewrite.hcl.search.FindContent
- Find content
- Find HCL content by path.
rewrite-hibernate
- io.moderne.hibernate.search.FindJPQLDefinitions
- Find JPQL definitions (Moderne Edition)
- Find Java Persistence Query Language definitions in the codebase.
- io.moderne.hibernate.update70.MigrateJdbcTypeToJdbcTypeCode
- Migrate @JdbcType to @JdbcTypeCode (Moderne Edition)
- In Hibernate 7.0, various JDBC types were moved to internal packages. Use @JdbcTypeCode with SqlTypes constants instead of @JdbcType with specific classes.
- org.openrewrite.hibernate.MigrateUserType
- Migrate
UserTypeto Hibernate 6 (Community Edition) - With Hibernate 6 the
UserTypeinterface received a type parameter making it more strictly typed. This recipe applies the changes required to adhere to this change.
- Migrate
rewrite-java
- org.openrewrite.java.ChangeMethodTargetToVariable
- Change method target to variable
- Change method invocations to method calls on a variable.
- org.openrewrite.java.ChangeTypeInStringLiteral
- Change type in String literals
- Change a given type to another when used in a String literal.
- org.openrewrite.java.CreateEmptyJavaClass
- Create Java class
- Create a new, empty Java class.
- org.openrewrite.java.NoStaticImport
- Remove static import
- Removes static imports and replaces them with qualified references. For example,
emptyList()becomesCollections.emptyList().
- org.openrewrite.java.RandomizeId
- Randomize tree IDs
- Scramble the IDs. This was intended as a utility to test en masse different techniques for UUID generation and compare their relative performance outside a microbenchmark.
- org.openrewrite.java.RecipeMarkupDemonstration
- Demonstrate rendering of
Markupmarkers - Tooling may decide to elide or display differently markup of different levels.
- Demonstrate rendering of
- org.openrewrite.java.RemoveImplements
- Remove interface implementations
- Removes
implementsclauses from classes implementing the specified interface. Removes@Overridesannotations from methods which no longer override anything.
- org.openrewrite.java.RemoveObjectsIsNull
- Transform calls to
Objects.isNull(..)andObjects.nonNull(..) - Replace calls to
Objects.isNull(..)andObjects.nonNull(..)with a simple null check. Using these methods outside of stream predicates is not idiomatic.
- Transform calls to
- org.openrewrite.java.ReplaceConstant
- Replace constant with literal value
- Replace a named constant with a literal value when you wish to remove the old constant. A
Stringliteral must include escaped quotes.
- org.openrewrite.java.UpdateSourcePositions
- Update source positions
- Calculate start position and length for every LST element.
- org.openrewrite.java.ai.ClassDefinitionLength
- Calculate token length of classes
- Locates class definitions and predicts the number of token in each.
- org.openrewrite.java.ai.MethodDefinitionLength
- Calculate token length of method definitions
- Locates method definitions and predicts the number of token in each.
- org.openrewrite.java.format.AutoFormat
- Format Java code
- Format Java code using a standard comprehensive set of Java formatting recipes.
- org.openrewrite.java.format.BlankLines
- Blank lines
- Add and/or remove blank lines.
- org.openrewrite.java.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.java.format.NormalizeLineBreaks
- Normalize line breaks
- Consistently use either Windows style (CRLF) or Linux style (LF) line breaks. If no
GeneralFormatStyleis specified this will use whichever style of line endings are more common.
- org.openrewrite.java.format.NormalizeTabsOrSpaces
- Normalize to tabs or spaces
- Consistently use either tabs or spaces in indentation.
- org.openrewrite.java.format.SingleLineComments
- Single line comments begin with a whitespace
- Write
// hiinstead of//hi.
- org.openrewrite.java.format.Spaces
- Spaces
- Format whitespace in Java code.
- org.openrewrite.java.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in Java code.
- org.openrewrite.java.format.TypecastParenPad
- Typecast parentheses padding
- Fixes whitespace padding between a typecast type identifier and the enclosing left and right parenthesis. For example, when configured to remove spacing,
( int ) 0L;becomes(int) 0L;.
- org.openrewrite.java.format.WrappingAndBraces
- Wrapping and braces
- Format line wraps and braces in Java code.
- org.openrewrite.java.search.ClasspathTypeCounts
- Study the size of the classpath by source set
- Emit one data table row per source set in a project, with the number of types in the source set.
- org.openrewrite.java.search.DoesNotUseType
- Check whether a type is not in use
- Useful as a precondition to skip over compilation units using the argument type.
- org.openrewrite.java.search.FindClassHierarchy
- Find class hierarchy
- Discovers all class declarations within a project, recording which files they appear in, their superclasses, and interfaces. That information is then recorded in a data table.
- org.openrewrite.java.search.FindCompileErrors
- Find compile errors
- Compile errors result in a particular LST structure that can be searched for.
- org.openrewrite.java.search.FindDeprecatedUses
- Find uses of deprecated classes, methods, and fields
- Find deprecated uses of methods, fields, and types. Optionally ignore those classes that are inside deprecated scopes.
- org.openrewrite.java.search.FindDistinctMethods
- Find distinct methods in use
- A sample of every distinct method in use in a repository. The code sample in the method calls data table will be a representative use of the method, though there may be many other such uses of the method.
- org.openrewrite.java.search.FindEmptyClasses
- Find empty classes
- Find empty classes without annotations that do not implement an interface or extend a class.
- org.openrewrite.java.search.FindEmptyMethods
- Find methods with empty bodies
- Find methods with empty bodies and single public no arg constructors.
- org.openrewrite.java.search.FindFields
- Find fields
- Find uses of a field.
- org.openrewrite.java.search.FindFieldsOfType
- Find fields of type
- Finds declared fields matching a particular class name.
- org.openrewrite.java.search.FindImports
- Find source files with imports
- Locates source files that have imports matching the given type pattern, regardless of whether that import is used in the code.
- org.openrewrite.java.search.FindLiterals
- Find literals
- Find literals matching a pattern.
- org.openrewrite.java.search.FindMethodDeclaration
- Find method declaration
- Locates the declaration of a method.
- org.openrewrite.java.search.FindMissingTypes
- Find missing type information on Java LSTs
- This is a diagnostic recipe to highlight where LSTs are missing type attribution information.
- org.openrewrite.java.search.FindRepeatableAnnotations
- Find uses of
@Repeatableannotations - Java 8 introduced the concept of
@Repeatableannotations.
- Find uses of
- org.openrewrite.java.search.FindTypeMappings
- Find type mappings
- Study the frequency of
Jtypes and theirJavaTypetype attribution.
- org.openrewrite.java.search.FindTypes
- Find types
- Find type references by name.
- org.openrewrite.java.search.HasBuildToolVersion
- Find files with a particular build tool version
- Finds Java source files built with a particular build tool. This is useful especially as a precondition for other recipes.
- org.openrewrite.java.search.HasJavaVersion
- Find files compiled at a specific Java version
- Finds Java source files matching a particular language level. This is useful especially as a precondition for other recipes.
- org.openrewrite.java.search.HasMethod
- Find files that have at least one use of a method
- Marks files that have at least one occurrence of a method matching a pattern.
- org.openrewrite.java.search.HasMinimumJavaVersion
- Find the oldest Java version in use
- The oldest Java version in use is the lowest Java version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Java 8, but a test source set uses Java 17. In this case, the oldest Java version in use is Java 8.
- org.openrewrite.java.search.HasSourceSet
- Find files in a source set
- Source sets are a way to organize your source code into logical groups. For example, Java projects commonly have a
mainsource set for application code and atestsource set for test code. This recipe will find all files in a given source set.
- org.openrewrite.java.search.HasType
- Find files that have at least one use of a type
- Marks files that have at least one occurrence of a type, even if the name of that type doesn't appear in the source code.
- org.openrewrite.java.search.IsLikelyNotTest
- Find files that are likely not tests
- Sources that do not contain indicators of being, or being exclusively for the use in tests. This recipe is simply a negation of the
org.openrewrite.java.search.IsLikelyTestrecipe.
- org.openrewrite.java.search.IsLikelyTest
- Find sources that are likely tests
- Sources that contain indicators of being, or being exclusively for the use in tests. This recipe is not exhaustive, but is intended to be a good starting point for finding test sources. Looks at the source set name, and types in use; for example looks for uses of JUnit & TestNG annotations/assertions.
- org.openrewrite.java.search.ResultOfMethodCallIgnored
- Result of method call ignored
- Find locations where the result of the method call is being ignored.
rewrite-java-dependencies
- org.openrewrite.java.dependencies.DependencyList
- Dependency report
- Emits a data table detailing all Gradle and Maven dependencies. This recipe makes no changes to any source file.
- org.openrewrite.java.dependencies.DependencyResolutionDiagnostic
- Dependency resolution diagnostic
- Recipes which manipulate dependencies must be able to successfully access the artifact repositories and resolve dependencies from them. This recipe produces two data tables used to understand the state of dependency resolution. The Repository accessibility report lists all the artifact repositories known to the project and whether respond to network access. The network access is attempted while the recipe is run and so is representative of current conditions. The Gradle dependency configuration errors lists all the dependency configurations that failed to resolve one or more dependencies when the project was parsed. This is representative of conditions at the time the LST was parsed.
- org.openrewrite.java.dependencies.FindDependency
- Find Maven and Gradle dependencies
- Finds direct dependencies declared in Maven and Gradle build files. This does not search transitive dependencies. To detect both direct and transitive dependencies use
org.openrewrite.java.dependencies.DependencyInsightThis recipe works for both Maven and Gradle projects.
- org.openrewrite.java.dependencies.RelocatedDependencyCheck
- Find relocated dependencies
- Find Maven and Gradle dependencies and Maven plugins that have relocated to a new
groupIdorartifactId. Relocation information comes from the oga-maven-plugin maintained by Jonathan Lermitage, Filipe Roque and others. This recipe makes no changes to any source file by default. AddchangeDependencies=trueto change dependencies, but note that you might need to run additional recipes to update imports and adopt other breaking changes.
- org.openrewrite.java.dependencies.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle or Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom.xml or Gradle build.gradle. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
- org.openrewrite.java.dependencies.search.DoesNotIncludeDependency
- Does not include dependency for Gradle and Maven
- A precondition which returns false if visiting a Gradle file / Maven pom which includes the specified dependency in the classpath of some Gradle configuration / Maven scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.java.dependencies.search.FindMinimumDependencyVersion
- Find the oldest matching dependency version in use
- The oldest dependency version in use is the lowest dependency version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Jackson 2.11, but a test source set uses Jackson 2.16. In this case, the oldest Jackson version in use is Java 2.11.
- org.openrewrite.java.dependencies.search.FindMinimumJUnitVersion
- Find minimum JUnit version
- A recipe to find the minimum version of JUnit dependencies. This recipe is designed to return the minimum version of JUnit in a project. It will search for JUnit 4 and JUnit 5 dependencies in the project. If both versions are found, it will return the minimum version of JUnit 4. If a minimumVersion is provided, the recipe will search to see if the minimum version of JUnit used by the project is no lower than the minimumVersion. For example: if the minimumVersion is 4, and the project has JUnit 4.12 and JUnit 5.7, the recipe will return JUnit 4.12. If the project has only JUnit 5.7, the recipe will return JUnit 5.7. Another example: if the minimumVersion is 5, and the project has JUnit 4.12 and JUnit 5.7, the recipe will not return any results.
- org.openrewrite.java.dependencies.search.ModuleHasDependency
- Module has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
- org.openrewrite.java.dependencies.search.RepositoryHasDependency
- Repository has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a repository with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use a springframework dependency, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
rewrite-java-security
- org.openrewrite.csharp.dependencies.DependencyInsight
- Dependency insight for C#
- Finds dependencies in
*.csprojandpackages.config.
- org.openrewrite.csharp.dependencies.DependencyVulnerabilityCheck
- Find and fix vulnerable Nuget dependencies
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this recipe will not make any changes. Vulnerability information comes from the GitHub Security Advisory Database, which aggregates vulnerability data from several public databases, including the National Vulnerability Database maintained by the United States government. Dependencies following Semantic Versioning will see their patch version updated where applicable.
- org.openrewrite.csharp.dependencies.UpgradeDependencyVersion
- Upgrade C# dependency versions
- Upgrades dependencies in
*.csprojandpackages.config.
- org.openrewrite.java.dependencies.DependencyLicenseCheck
- Find licenses in use in third-party dependencies
- Locates and reports on all licenses in use.
- org.openrewrite.java.dependencies.RemoveUnusedDependencies
- Remove unused dependencies
- Scans through source code collecting references to types and methods, removing any dependencies that are not used from Maven or Gradle build files. This is best effort and not guaranteed to work well in all cases; false positives are still possible. This recipe takes reflective access into account: - When reflective access to a class is made unambiguously via a string literal, such as:
Class.forName("java.util.List")that is counted correctly. - When reflective access to a class is made ambiguously via anything other than a string literal no dependencies will be removed. This recipe takes transitive dependencies into account: - When a direct dependency is not used but a transitive dependency it brings in is in use the direct dependency is not removed.
- org.openrewrite.java.dependencies.SoftwareBillOfMaterials
- Software bill of materials
- Produces a software bill of materials (SBOM) for a project. An SBOM is a complete list of all dependencies used in a project, including transitive dependencies. The produced SBOM is in the CycloneDX XML format. Supports Gradle and Maven. Places a file named sbom.xml adjacent to the Gradle or Maven build file.
- org.openrewrite.java.security.FixCwe338
- Fix CWE-338 with
SecureRandom - Use a cryptographically strong pseudo-random number generator (PRNG).
- Fix CWE-338 with
- org.openrewrite.java.security.ImproperPrivilegeManagement
- Improper privilege management
- Marking code as privileged enables a piece of trusted code to temporarily enable access to more resources than are available directly to the code that called it.
- org.openrewrite.java.security.SecureRandom
- Secure random
- Use cryptographically secure Pseudo Random Number Generation in the "main" source set. Replaces instantiation of
java.util.Randomwithjava.security.SecureRandom.
- org.openrewrite.java.security.SecureRandomPrefersDefaultSeed
- SecureRandom seeds are not constant or predictable
- Remove
SecureRandom#setSeed(*)method invocations having constant or predictable arguments.
- org.openrewrite.java.security.search.FindSensitiveApiEndpoints
- Find sensitive API endpoints
- Find data models exposed by REST APIs that contain sensitive information like PII and secrets.
- org.openrewrite.java.security.spring.InsecureSpringServiceExporter
- Secure Spring service exporters
- The default Java deserialization mechanism is available via
ObjectInputStreamclass. This mechanism is known to be vulnerable. If an attacker can make an application deserialize malicious data, it may result in arbitrary code execution. Spring’sRemoteInvocationSerializingExporteruses the default Java deserialization mechanism to parse data. As a result, all classes that extend it are vulnerable to deserialization attacks. The Spring Framework contains at leastHttpInvokerServiceExporterandSimpleHttpInvokerServiceExporterthat extendRemoteInvocationSerializingExporter. These exporters parse data from the HTTP body using the unsafe Java deserialization mechanism. See the full blog post by Artem Smotrakov on CVE-2016-1000027 from which the above description is excerpted.
- org.openrewrite.java.security.spring.PreventClickjacking
- Prevent clickjacking
- The
frame-ancestorsdirective can be used in a Content-Security-Policy HTTP response header to indicate whether or not a browser should be allowed to render a page in a<frame>or<iframe>. Sites can use this to avoid Clickjacking attacks by ensuring that their content is not embedded into other sites.
- org.openrewrite.text.FindHardcodedLoopbackAddresses
- Find hard-coded loopback IPv4 addresses
- Locates mentions of hard-coded IPv4 addresses from the loopback IP range. The loopback IP range includes
127.0.0.0to127.255.255.255. This detects the entire localhost/loopback subnet range, not just the commonly used127.0.0.1.
- org.openrewrite.text.FindHardcodedPrivateIPAddresses
- Find hard-coded private IPv4 addresses
- Locates mentions of hard-coded IPv4 addresses from private IP ranges. Private IP ranges include: *
192.168.0.0to192.168.255.255*10.0.0.0to10.255.255.255*172.16.0.0to172.31.255.255It is not detecting the localhost subnet127.0.0.0to127.255.255.255.
- org.openrewrite.text.RemoveHardcodedIPAddressesFromComments
- Remove hard-coded IP addresses from comments
- Removes hard-coded IPv4 addresses from comments when they match private IP ranges or loopback addresses. This targets IP addresses that are commented out in various comment formats: Private IP ranges: *
192.168.0.0to192.168.255.255*10.0.0.0to10.255.255.255*172.16.0.0to172.31.255.255Loopback IP range: *127.0.0.0to127.255.255.255Supported comment formats: * C-style line comments (//) * C-style block comments (/* */) * Shell/Python style comments (#) * XML comments (<!-- -->) * YAML comments (#) * Properties file comments (#or!) For line comments, the entire line is removed. For block comments, only the IP address is removed.
rewrite-javascript
- org.openrewrite.javascript.search.DependencyInsight
- Node.js dependency insight
- Find direct and transitive npm dependencies matching a package name pattern. Results include dependencies that either directly match or transitively include a matching dependency.
rewrite-jenkins
- org.openrewrite.jenkins.AddJellyXmlDeclaration
- Add XML declaration to Jelly files
- Ensure the XML declaration
<?jelly escape-by-default='true'?>is present in all.jellyfiles.
- org.openrewrite.jenkins.CreateIndexJelly
- Create
index.jellyif it doesn't exist - Jenkins tooling requires
src/main/resources/index.jellyexists with a description.
- Create
- org.openrewrite.jenkins.IsJenkinsPlugin
- Is the project a Jenkins plugin?
- Checks if the project is a Jenkins plugin by the presence of a managed version of
jenkins-core.
- org.openrewrite.jenkins.github.AddTeamToCodeowners
- Add plugin developer team to CODEOWNERS
- Adds the
{artifactId}-plugin-developersteam to all files in.github/CODEOWNERSif absent.
rewrite-json
- org.openrewrite.json.AddKeyValue
- Add value to JSON Object
- Adds a
valueat the specifiedkeyPathwith the specifiedkey, if the key doesn't already exist.
- org.openrewrite.json.ChangeKey
- Change key
- Change a JSON mapping entry key, while leaving the value intact.
- org.openrewrite.json.ChangeValue
- Change value
- Change a JSON mapping entry value leaving the key intact.
- org.openrewrite.json.CopyValue
- Copy JSON value
- Copies a JSON value from one key to another. The existing key/value pair remains unaffected by this change. Attempts to create the new key if it does not exist.
- org.openrewrite.json.CreateJsonFile
- Create JSON file
- Create a new JSON file.
- org.openrewrite.json.DeleteKey
- Delete key
- Delete a JSON mapping entry key.
- org.openrewrite.json.format.AutoFormat
- Format JSON
- Format JSON code using a standard comprehensive set of JSON formatting recipes.
- org.openrewrite.json.format.Indents
- JSON indent
- Format tabs and indents in JSON.
- org.openrewrite.json.format.WrappingAndBraces
- JSON new lines
- Split members into separate lines in JSON.
- org.openrewrite.json.search.FindKey
- Find JSON object members
- Find JSON object members by JsonPath expression.
rewrite-kotlin
- org.openrewrite.kotlin.FindKotlinSources
- Find Kotlin sources and collect data metrics
- Use data table to collect source files types and counts of files with extensions
.kt.
- org.openrewrite.kotlin.OrderImports
- Order Kotlin imports
- Groups and orders import statements. If a style has been defined, this recipe will order the imports according to that style. If no style is detected, this recipe will default to ordering imports in the same way that IntelliJ IDEA does.
- org.openrewrite.kotlin.RenameTypeAlias
- Rename type alias
- Change the name of a given type alias.
- org.openrewrite.kotlin.cleanup.RemoveLambdaArgumentParentheses
- Remove method invocation parentheses around single lambda argument
- For example, convert
1.let({ it + 1 })to1.let { it + 1 }.
- org.openrewrite.kotlin.cleanup.RemoveTrailingComma
- Remove trailing comma in Kotlin
- Remove trailing commas in variable, parameter, and class property lists.
- org.openrewrite.kotlin.cleanup.RemoveTrailingSemicolon
- Remove unnecessary trailing semicolon
- Some Java programmers may mistakenly add semicolons at the end when writing Kotlin code, but in reality, they are not necessary.
- org.openrewrite.kotlin.cleanup.UnnecessaryTypeParentheses
- Remove unnecessary parentheses on Kotlin types
- In Kotlin, it's possible to add redundant nested parentheses in type definitions. This recipe is designed to remove those unnecessary parentheses.
- org.openrewrite.kotlin.format.AutoFormat
- Format Kotlin code
- Format Kotlin code using a standard comprehensive set of Kotlin formatting recipes.
rewrite-kubernetes
- org.openrewrite.kubernetes.UpdateContainerImageName
- Update image name
- Search for image names that match patterns and replace the components of the name with new values.
- org.openrewrite.kubernetes.rbac.AddRuleToRole
- Add RBAC rules
- Add RBAC rules to ClusterRoles or namespaced Roles.
- org.openrewrite.kubernetes.resource.CapResourceValueToMaximum
- Cap exceeds resource value
- Cap resource values that exceed a specific maximum.
- org.openrewrite.kubernetes.resource.FindExceedsResourceRatio
- Find exceeds resource ratio
- Find resource manifests that have requests to limits ratios beyond a specific maximum.
- org.openrewrite.kubernetes.resource.FindExceedsResourceValue
- Find exceeds resource limit
- Find resource manifests that have limits set beyond a specific maximum.
- org.openrewrite.kubernetes.search.FindAnnotation
- Find annotation
- Find annotations that optionally match a given regex.
- org.openrewrite.kubernetes.search.FindDisallowedImageTags
- Find disallowed image tags
- The set of image tags to find which are considered disallowed.
- org.openrewrite.kubernetes.search.FindImage
- Find image by name
- The image name to search for in containers and initContainers.
- org.openrewrite.kubernetes.search.FindMissingDigest
- Find missing image digest
- Find instances of a container name that fails to specify a digest.
- org.openrewrite.kubernetes.search.FindMissingOrInvalidAnnotation
- Find annotation
- Find annotations that optionally match a given value.
- org.openrewrite.kubernetes.search.FindMissingOrInvalidLabel
- Find label
- Find labels that optionally match a given regex.
- org.openrewrite.kubernetes.search.FindNonTlsIngress
- Find non-TLS Ingresses
- Find Ingress resources that don't disallow HTTP or don't have TLS configured.
- org.openrewrite.kubernetes.services.FindServiceExternalIPs
- Find uses of
externalIP - Find any
ServicewhoseexternalIPlist contains, or does not contain, one of a list of IPs.
- Find uses of
- org.openrewrite.kubernetes.services.FindServicesByType
- Service type
- Type of Kubernetes
Serviceto find.
- org.openrewrite.kubernetes.services.UpdateServiceExternalIP
- Update
ServiceexternalIP - Swap out an IP address with another one in
ServiceexternalIPsettings.
- Update
rewrite-liberty
- org.openrewrite.java.liberty.ReplaceWSPrincipalGetCredential
- Replace
WSPrincipal.getCredential()withWSSubjectlookup - Replaces
WSCredential credential = WSPrincipal.getCredential();with anullinitializer +try/catchlookup.
- Replace
- org.openrewrite.xml.liberty.WebBeansXmlRule
- Replace beans.xml file
- This Recipe replaces OpenWebBeans schema in every beans.xml with the standard CDI schema.
rewrite-logging-frameworks
- org.openrewrite.java.logging.SystemPrintToLogging
- Use logger instead of system print statements
- Replace
System.outandSystem.errprint statements with a logger.
- org.openrewrite.java.logging.log4j.LoggingExceptionConcatenationRecipe
- Log exceptions as parameters rather than as string concatenations
- By using the exception as another parameter you get the whole stack trace.
- org.openrewrite.java.logging.log4j.PrependRandomName
- Prepend a random name to each Log4J statement
- To make finding the callsite of a logging statement easier in code search.
- org.openrewrite.java.logging.logback.ConfigureLoggerLevel
- Configure logback logger level
- Within logback.xml configuration files sets the specified log level for a particular class. Will not create a logback.xml if one does not already exist.
- org.openrewrite.java.logging.slf4j.ChangeLogLevel
- Change SLF4J log level
- Change the log level of SLF4J log statements.
rewrite-maven
- org.openrewrite.maven.AddCommentToMavenDependency
- Add a comment to a
Mavendependency or plugin - Adds a comment as the first element in a
Mavendependency or plugin.
- Add a comment to a
- org.openrewrite.maven.AddDevelocityMavenExtension
- Add the Develocity Maven extension
- To integrate the Develocity Maven extension into Maven projects, ensure that the
develocity-maven-extensionis added to the.mvn/extensions.xmlfile if not already present. Additionally, configure the extension by adding the.mvn/develocity.xmlconfiguration file.
- org.openrewrite.maven.AddParentPom
- Add Maven parent
- Add a parent pom to a Maven pom.xml. Does nothing if a parent pom is already present.
- org.openrewrite.maven.AddRepository
- Add repository
- Adds a new Maven Repository or updates a matching repository.
- org.openrewrite.maven.AddRuntimeConfig
- Add a configuration option for the Maven runtime
- Add a new configuration option for the Maven runtime if not already present.
- org.openrewrite.maven.ChangeExclusion
- Change Maven dependency exclusion
- Modify Maven dependency exclusions, changing the group ID, artifact Id, or both. Useful when an excluded dependency has been renamed and references to it must be updated.
- org.openrewrite.maven.ChangePluginConfiguration
- Change Maven plugin configuration
- Apply the specified configuration to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangePluginDependencies
- Change Maven plugin dependencies
- Applies the specified dependencies to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangeProjectVersion
- Change Maven Project Version
- Change the project version of a Maven pom.xml. Identifies the project to be changed by its groupId and artifactId. If the version is defined as a property, this recipe will only change the property value if the property exists within the same pom.
- org.openrewrite.maven.EnableDevelocityBuildCache
- Enable Develocity build cache
- Add Develocity build cache configuration to any
.mvn/Develocity configuration file that lack existing configuration.
- org.openrewrite.maven.IncrementProjectVersion
- Increment Maven project version
- Increase Maven project version by incrementing either the major, minor, or patch version as defined by semver. Other versioning schemes are not supported.
- org.openrewrite.maven.ManageDependencies
- Manage dependencies
- Make existing dependencies managed by moving their version to be specified in the dependencyManagement section of the POM.
- org.openrewrite.maven.ManagedToRuntimeDependencies
- Convert managed dependencies to runtime dependencies
- This recipe processes Maven POMs, converting all
<dependencyManagement>entries into runtime scoped<dependencies>entries. Import scoped BOMs (like jackson-bom) are left unmodified in<dependencyManagement>. Some style guidelines prefer that<dependencyManagement>be used only for BOMs. This maintain that style while avoiding introducing new symbols onto the compile classpath unintentionally.
- org.openrewrite.maven.ModernizeObsoletePoms
- Modernize obsolete Maven poms
- Very old Maven poms are no longer supported by current versions of Maven. This recipe updates poms with
<pomVersion>3</pomVersion>to<modelVersion>4.0.0</modelVersion>of the Maven pom schema. This does not attempt to upgrade old dependencies or plugins and is best regarded as the starting point of a migration rather than an end-point.
- org.openrewrite.maven.RemoveRepository
- Remove repository
- Removes a matching Maven repository.
- org.openrewrite.maven.RemoveUnusedProperties
- Remove unused properties
- Detect and remove Maven property declarations which do not have any usage within the project.
- org.openrewrite.maven.UpdateMavenWrapper
- Update Maven wrapper
- Update the version of Maven used in an existing Maven wrapper.
- org.openrewrite.maven.UpgradeTransitiveDependencyVersion
- Upgrade transitive Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom file. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
- org.openrewrite.maven.cleanup.DependencyManagementDependencyRequiresVersion
- Dependency management dependencies should have a version
- If they don't have a version, they can't possibly affect dependency resolution anywhere, and can be safely removed.
- org.openrewrite.maven.search.DoesNotIncludeDependency
- Does not include Maven dependency
- A precondition which returns false if visiting a Maven pom which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.maven.search.EffectiveDependencies
- Effective dependencies
- Emit the data of binary dependency relationships.
- org.openrewrite.maven.search.EffectiveManagedDependencies
- Effective managed dependencies
- Emit the data of binary dependency relationships.
- org.openrewrite.maven.search.EffectiveMavenRepositories
- List effective Maven repositories
- Lists the Maven repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Maven settings file (and those contributed by active profiles) as determined when the LST was produced.
- org.openrewrite.maven.search.FindManagedDependency
- Find Maven dependency management entry
- Finds first-order dependency management entries, i.e. dependencies that are defined directly in a project.
- org.openrewrite.maven.search.FindMavenProject
- Find Maven projects
- Maven projects are
pom.xmlfiles with aMavenResolutionResultmarker.
- org.openrewrite.maven.search.FindMavenSettings
- Find effective maven settings
- List the effective maven settings file for the current project.
- org.openrewrite.maven.search.FindPlugin
- Find Maven plugin
- Finds a Maven plugin within a pom.xml.
- org.openrewrite.maven.search.FindProperties
- Find Maven project properties
- Finds the specified Maven project properties within a pom.xml.
- org.openrewrite.maven.search.FindRepositoryOrder
- Maven repository order
- Determine the order in which dependencies will be resolved for each
pom.xmlbased on its defined repositories and effectivesettings.xml.
- org.openrewrite.maven.search.FindScm
- Find SCM tag
- Finds any
<scm>tag directly inside the<project>root of a Maven pom.xml file.
- org.openrewrite.maven.search.ModuleHasDependency
- Module has dependency
- Searches for Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindDependencyrecipe instead.
- org.openrewrite.maven.search.ModuleHasPlugin
- Module has plugin
- Searches for Maven modules that have a plugin matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring boot plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
- org.openrewrite.maven.search.ParentPomInsight
- Maven parent insight
- Find Maven parents matching a
groupIdandartifactId.
- org.openrewrite.maven.utilities.PrintMavenAsDot
- Print Maven dependency hierarchy in DOT format
- The DOT language format is specified here.
rewrite-micrometer
- org.openrewrite.micrometer.dropwizard.FindDropwizardMetrics
- Find Dropwizard metrics
- Find uses of Dropwizard metrics that could be converted to a more modern metrics instrumentation library.
rewrite-micronaut
- org.openrewrite.java.micronaut.FindPropertiesConfig
- Find Micronaut properties config
- Find Micronaut properties configuration files.
- org.openrewrite.java.micronaut.FindYamlConfig
- Find Micronaut yaml config
- Find Micronaut yaml configuration files.
rewrite-migrate-java
- org.openrewrite.java.migrate.AddJDeprScanPlugin
- Add
JDeprScanMaven Plug-in - Add the
JDeprScanMaven plugin to scan class files for uses of deprecated APIs.
- Add
- org.openrewrite.java.migrate.AddSuppressionForIllegalReflectionWarningsPlugin
- Add maven jar plugin to suppress illegal reflection warnings
- Adds a maven jar plugin that's configured to suppress Illegal Reflection Warnings.
- org.openrewrite.java.migrate.DontOverfetchDto
- Replace DTO method parameters with data elements
- Replace method parameters that have DTOs with their data elements when only the specified data element is used.
- org.openrewrite.java.migrate.RemoveIllegalSemicolons
- Remove illegal semicolons
- Remove semicolons after package declarations and imports, no longer accepted in Java 21 as of JDK-8027682.
- org.openrewrite.java.migrate.ReplaceStringLiteralValue
- Replace
Stringliteral - Replace the value of a complete
Stringliteral.
- Replace
- org.openrewrite.java.migrate.UseTabsOrSpaces
- Force indentation to either tabs or spaces
- This is useful for one-off migrations of a codebase that has mixed indentation styles, while preserving all other auto-detected formatting rules.
- org.openrewrite.java.migrate.io.AddInputStreamBulkReadMethod
- Add bulk read method to
InputStreamimplementations - Adds a
read(byte[], int, int)method toInputStreamsubclasses that only override the single-byteread()method. Java's defaultInputStream.read(byte[], int, int)implementation calls the single-byteread()method in a loop, which can cause severe performance degradation (up to 350x slower) for bulk reads. This recipe detectsInputStreamimplementations that delegate to another stream and adds the missing bulk read method to delegate bulk reads as well.
- Add bulk read method to
- org.openrewrite.java.migrate.io.ReplaceFileInOrOutputStreamFinalizeWithClose
- Replace invocations of
finalize()onFileInputStreamandFileOutputStreamwithclose() - Replace invocations of the deprecated
finalize()method onFileInputStreamandFileOutputStreamwithclose().
- Replace invocations of
- org.openrewrite.java.migrate.jakarta.HasNoJakartaAnnotations
- Project has no Jakarta annotations
- Mark all source as found per
JavaProjectwhere no Jakarta annotations are found. This is useful mostly as a precondition for recipes that require Jakarta annotations to be present.
- org.openrewrite.java.migrate.javax.AddScopeToInjectedClass
- Add scope annotation to injected classes
- Finds member variables annotated with
@Inject' and applies@Dependent` scope annotation to the variable's type.
- org.openrewrite.java.migrate.lang.IfElseIfConstructToSwitch
- If-else-if-else to switch
- Replace if-else-if-else with switch statements. In order to be replaced with a switch, all conditions must be on the same variable and there must be at least three cases.
- org.openrewrite.java.migrate.lang.StringRulesRecipes
- A collection of
Stringrules - A collection of rules for refactoring methods called on
Stringinstances in Java code.
- A collection of
- org.openrewrite.java.migrate.lang.UseStringIsEmptyRecipe
- Replace
0 < s.length()with!s.isEmpty() - Replace
0 < s.length()ands.length() != 0with!s.isEmpty().
- Replace
- org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames
- Rename getter methods to fit Lombok
- Rename methods that are effectively getter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same getter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() { return ba; } int getBa() { return foo; }stays as it is.
- org.openrewrite.java.migrate.lombok.AdoptLombokSetterMethodNames
- Rename setter methods to fit Lombok
- Rename methods that are effectively setter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same setter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() { return ba; } int getBa() { return foo; }stays as it is.
- org.openrewrite.java.migrate.lombok.LombokValueToRecord
- Convert
@lombok.Valueclass to Record - Convert Lombok
@Valueannotated classes to standard Java Records.
- Convert
- org.openrewrite.java.migrate.maven.UpdateMavenProjectPropertyJavaVersion
- Update Maven Java project properties
- The Java version is determined by several project properties, including: *
java.version*jdk.version*javaVersion*jdkVersion*maven.compiler.source*maven.compiler.target*maven.compiler.release*release.versionIf none of these properties are in use and the maven compiler plugin is not otherwise configured, adds themaven.compiler.releaseproperty.
- org.openrewrite.java.migrate.maven.UseMavenCompilerPluginReleaseConfiguration
- Use Maven compiler plugin release configuration
- Replaces any explicit
sourceortargetconfiguration (if present) on themaven-compiler-pluginwithrelease, and updates thereleasevalue if needed. Will not downgrade the Java version if the current version is higher.
- org.openrewrite.java.migrate.metrics.SimplifyMicrometerMeterTags
- Simplify Micrometer meter tags
- Use the simplest method to add new tags.
- org.openrewrite.java.migrate.net.URLConstructorsToNewURI
- Convert
new URL(String, ..)tonew URI(String, ..).toURL() - Converts
new URL(String, ..)constructors tonew URI(String, ..).toURL().
- Convert
- org.openrewrite.java.migrate.search.AboutJavaVersion
- Find which Java version is in use
- A diagnostic for studying the distribution of Java language version levels (both source and target compatibility across files and source sets).
- org.openrewrite.java.migrate.search.FindDataUsedOnDto
- Find data used on DTOs
- Find data elements used on DTOs. This is useful to provide information where data over-fetching may be a problem.
- org.openrewrite.java.migrate.search.FindDtoOverfetching
- Find methods that only use one DTO data element
- Find methods that have 'opportunities' for improvement.
- org.openrewrite.java.migrate.search.FindInternalJavaxApis
- Find uses of internal javax APIs
- The libraries that define these APIs will have to be migrated before any of the repositories that use them.
- org.openrewrite.java.migrate.search.FindJavaVersion
- Find Java versions in use
- Finds Java versions in use.
- org.openrewrite.java.migrate.search.FindLocaleDateTimeFormats
- Find locale-sensitive date/time formatting
- Finds usages of locale-based date/time formatting APIs that may be affected by JDK 20+ CLDR locale data changes, where the space before AM/PM was changed from a regular space to a narrow no-break space (NNBSP).
- org.openrewrite.java.migrate.search.PlanJavaMigration
- Plan a Java version migration
- Study the set of Java versions and associated tools in use across many repositories.
- org.openrewrite.java.migrate.util.RemoveFinalizerFromZip
- Remove invocations of deprecated invocations from Deflater, Inflater, ZipFile
- Remove invocations of finalize() deprecated invocations from Deflater, Inflater, ZipFile.
- org.openrewrite.java.migrate.util.UseEnumSetOf
- Prefer
EnumSet of(..) - Prefer
EnumSet of(..)instead of usingSet of(..)when the arguments are enums in Java 9 or higher.
- Prefer
rewrite-nodejs
- org.openrewrite.nodejs.DependencyVulnerabilityCheck
- Find and fix vulnerable npm dependencies
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this recipe will not make any changes. Vulnerability information comes from the GitHub Security Advisory Database, which aggregates vulnerability data from several public databases, including the National Vulnerability Database maintained by the United States government. Dependencies following Semantic Versioning will see their patch version updated where applicable.
- org.openrewrite.nodejs.UpgradeDependencyVersion
- Upgrade Node.js dependencies
- Upgrade matching Node.js direct dependencies.
- org.openrewrite.nodejs.search.FindNodeProjects
- Find Node.js projects
- Find Node.js projects and summarize data about them.
rewrite-program-analysis
- org.openrewrite.analysis.java.FindNullPointerIssues
- Find null pointer issues
- Detects potential null pointer dereferences using path-sensitive analysis to distinguish between definite NPEs, possible NPEs, and safe dereferences.
- org.openrewrite.analysis.java.controlflow.FindUnusedDefinitions
- Find unused variable definitions
- Identifies variable assignments whose values are never used before being overwritten.
- org.openrewrite.analysis.java.controlflow.search.FindCyclomaticComplexity
- Find cyclomatic complexity
- Calculates the cyclomatic complexity of methods and produces a data table containing the class name, method name, argument types, complexity value, and complexity threshold.
- org.openrewrite.analysis.java.controlflow.search.FindUnreachableCode
- Find unreachable code
- Uses control flow analysis to identify statements that can never be executed.
- org.openrewrite.analysis.java.dataflow.FindDeadStores
- Find dead stores
- Identifies variable assignments whose values are never used before being overwritten or going out of scope.
- org.openrewrite.analysis.java.datalineage.TrackDataLineage
- Track data lineage
- Tracks the flow of data from database sources (JDBC queries, JPA entities) to API sinks (REST endpoints, GraphQL mutations) to understand data dependencies and support compliance requirements.
- org.openrewrite.analysis.java.privacy.FindPiiExposure
- Find PII exposure in logs and external APIs
- Detects when Personally Identifiable Information (PII) is exposed through logging statements or sent to external APIs without proper sanitization. This helps prevent data leaks and ensures compliance with privacy regulations like GDPR and CCPA.
- org.openrewrite.analysis.java.security.FindCommandInjection
- Find command injection vulnerabilities
- Detects when user-controlled input flows into system command execution methods like Runtime.exec() or ProcessBuilder, which could allow attackers to execute arbitrary commands.
- org.openrewrite.analysis.java.security.FindSecurityVulnerabilities
- Find security vulnerabilities using taint analysis
- Identifies potential security vulnerabilities where untrusted data from sources flows to sensitive sinks without proper sanitization.
rewrite-properties
- org.openrewrite.properties.AddPropertyComment
- Add comment before property key
- Add a new comment before a property key if not already present, optionally commenting out the property.
rewrite-quarkus
- org.openrewrite.quarkus.Slf4jToQuarkusLogger
- Migrate SLF4J Logger injection and usage to Quarkus static
Log - Removes usage of SLF4J Logger fields, adjusts imports, and replaces logger method calls with static Quarkus Log calls, including message formatting and method renaming for parameterized logging.
- Migrate SLF4J Logger injection and usage to Quarkus static
- org.openrewrite.quarkus.search.FindQuarkusProfiles
- Search Quarkus profiles
- Search the properties for existing Quarkus profiles.
- org.openrewrite.quarkus.search.FindQuarkusProperties
- Find Quarkus property
- Finds occurrences of a Quarkus property key.
rewrite-react
- org.openrewrite.react.search.FindPropUsage
- Find React prop usage
- Locates usages of a specific prop of a React component.
- org.openrewrite.react.search.FindReactComponent
- Find React component
- Locates usages of React components across the codebase including JSX elements and other references. If
componentNameisnull, finds all React components.
rewrite-rewrite
- org.openrewrite.java.recipes.FindRecipes
- Find OpenRewrite recipes
- This recipe finds all OpenRewrite recipes, primarily to produce a data table that is being used to experiment with fine-tuning a large language model to produce more recipes.
rewrite-spring
- io.moderne.java.spring.boot.IsLikelyNotSpringBoot
- Is likely not a Spring Boot project
- Marks the project if it's likely not a Spring Boot project.
- io.moderne.java.spring.boot.IsLikelySpringBoot
- Is likely a Spring Boot project
- Marks the project if it's likely a Spring Boot project.
- io.moderne.java.spring.boot4.AddAutoConfigureMockMvc
- Add
@AutoConfigureMockMvcto@SpringBootTestclasses usingMockMvc - Adds
@AutoConfigureMockMvcannotation to classes annotated with@SpringBootTestthat useMockMvc.
- Add
- io.moderne.java.spring.framework.IsLikelySpringFramework
- Is likely a Spring Framework project
- Marks the project if it's likely a Spring Framework project.
- io.moderne.java.spring.framework.JaxRsToSpringWeb
- Convert JAX-RS annotations to Spring Web
- Converts JAX-RS annotations such as
@Path,@GET,@POST, etc., to their Spring Web equivalents like@RestController,@RequestMapping,@GetMapping, etc.
- org.openrewrite.gradle.spring.AddSpringDependencyManagementPlugin
- Add
io.spring.dependency-managementplugin, if in use - Prior to Spring Boot 2.0 the dependency management plugin was applied automatically as part of the overall spring boot plugin. Afterwards the dependency-management plugin must be applied explicitly, or Gradle's
platform()feature may be used instead. This recipe makes usage of io-spring.dependency-management explicit in anticipation of upgrade to Spring Boot 2.0 or later.
- Add
- org.openrewrite.java.spring.ExpandProperties
- Expand Spring YAML properties
- Expand YAML properties to not use the dot syntax shortcut.
- org.openrewrite.java.spring.ImplicitWebAnnotationNames
- Remove implicit web annotation names
- Removes implicit web annotation names.
- org.openrewrite.java.spring.RenameBean
- Rename bean
- Renames a Spring bean, both declaration and references.
- org.openrewrite.java.spring.UpdateApiManifest
- Update the API manifest
- Keep a consolidated manifest of the API endpoints that this application exposes up-to-date.
- org.openrewrite.java.spring.amqp.UseTlsAmqpConnectionString
- Use TLS for AMQP connection strings
- Use TLS for AMQP connection strings.
- org.openrewrite.java.spring.boot2.AddConfigurationAnnotationIfBeansPresent
- Add missing
@Configurationannotation - Class having
@Beanannotation over any methods but missing@Configurationannotation over the declaring class would have@Configurationannotation added.
- Add missing
- org.openrewrite.java.spring.boot2.ConditionalOnBeanAnyNestedCondition
- Migrate multi-condition
@ConditionalOnBeanannotations - Migrate multi-condition
@ConditionalOnBeanannotations toAnyNestedCondition.
- Migrate multi-condition
- org.openrewrite.java.spring.boot2.search.IntegrationSchedulerPoolRecipe
- Integration scheduler pool size
- Spring Integration now reuses an available
TaskSchedulerrather than configuring its own. In a typical application setup relying on the auto-configuration, this means that Spring Integration uses the auto-configured task scheduler that has a pool size of 1. To restore Spring Integration’s default of 10 threads, use thespring.task.scheduling.pool.sizeproperty.
- org.openrewrite.java.spring.boot3.AddRouteTrailingSlash
- Add trailing slash to Spring routes
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to add declaration of additional route explicitly on the controller handler (like@GetMapping("/some/greeting", "/some/greeting/").
- org.openrewrite.java.spring.boot3.AddSetUseTrailingSlashMatch
- Add
SetUseTrailingSlashMatch()in configuration - This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is change the default with the global Spring MVC or Webflux configuration.
- Add
- org.openrewrite.java.spring.boot3.MaintainTrailingSlashURLMappings
- Maintain trailing slash URL mappings
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to maintain trailing slash in all HTTP url mappings.
- org.openrewrite.java.spring.data.UseTlsJdbcConnectionString
- Use TLS for JDBC connection strings
- Increasingly, for compliance reasons (e.g. NACHA), JDBC connection strings should be TLS-enabled. This recipe will update the port and optionally add a connection attribute to indicate that the connection is TLS-enabled.
- org.openrewrite.java.spring.search.FindApiCalls
- Find HTTP API calls via
RestTemplate - Find outbound HTTP API calls made via Spring's
RestTemplateclass.
- Find HTTP API calls via
- org.openrewrite.java.spring.search.FindApiEndpoints
- Find Spring API endpoints
- Find all HTTP API endpoints exposed by Spring applications. More specifically, this marks method declarations annotated with
@RequestMapping,@GetMapping,@PostMapping,@PutMapping,@DeleteMapping, and@PatchMappingas search results.
- org.openrewrite.java.spring.search.FindConfigurationProperties
- Find Spring
@ConfigurationProperties - Find all classes annotated with
@ConfigurationPropertiesand extract their prefix values. This is useful for discovering all externalized configuration properties in Spring Boot applications.
- Find Spring
- org.openrewrite.java.spring.search.FindSpringComponents
- Find Spring components
- Find Spring components, including controllers, services, repositories, return types of
@Beanannotated methods, etc.
- org.openrewrite.java.spring.security6.RemoveOauth2LoginConfig
- Remove unneeded
oauth2Loginconfig when upgrading to Spring Security 6 oauth2Login()is a Spring Security feature that allows users to authenticate with an OAuth2 or OpenID Connect 1.0 provider. When a user is authenticated using this feature, they are granted a set of authorities that determines what actions they are allowed to perform within the application. In Spring Security 5, the default authority given to a user authenticated with an OAuth2 or OpenID Connect 1.0 provider viaoauth2Login()isROLE_USER. This means that the user is allowed to access the application's resources as a regular user. However, in Spring Security 6, the default authority given to a user authenticated with an OAuth2 provider isOAUTH2_USER, and the default authority given to a user authenticated with an OpenID Connect 1.0 provider isOIDC_USER. These authorities are more specific and allow for better customization of the user's permissions within the application. If you are upgrading to Spring Security 6 and you have previously configured aGrantedAuthoritiesMapperto handle the authorities of users authenticated viaoauth2Login(), you can remove it completely as the new default authorities should be sufficient.
- Remove unneeded
- org.openrewrite.maven.spring.UpgradeExplicitSpringBootDependencies
- Upgrade Spring dependencies
- Upgrades dependencies according to the specified version of spring boot. Spring boot has many direct and transitive dependencies. When a module has an explicit dependency on one of these it may also need to be upgraded to match the version used by spring boot.
rewrite-sql
- org.openrewrite.sql.FindSql
- Find SQL in code and resource files
- Find SQL in code (e.g. in string literals) and in resources like those ending with
.sql.
- org.openrewrite.sql.search.FindFunction
- Find SQL function
- Find SQL functions by name.
rewrite-static-analysis
- org.openrewrite.staticanalysis.AddSerialVersionUidToSerializable
- Add
serialVersionUIDto aSerializableclass when missing - A
serialVersionUIDfield is strongly recommended in allSerializableclasses. If this is not defined on aSerializableclass, the compiler will generate this value. If a change is later made to the class, the generated value will change and attempts to deserialize the class will fail.
- Add
- org.openrewrite.staticanalysis.AvoidBoxedBooleanExpressions
- Avoid boxed boolean expressions
- Under certain conditions the
java.lang.Booleantype is used as an expression, and it may throw aNullPointerExceptionif the value is null.
- org.openrewrite.staticanalysis.CombineSemanticallyEqualCatchBlocks
- Combine semantically equal catch blocks
- Combine catches in a try that contain semantically equivalent blocks. No change will be made when a caught exception exists if combining catches may change application behavior or type attribution is missing.
- org.openrewrite.staticanalysis.ControlFlowIndentation
- Control flow statement indentation
- Program flow control statements like
if,while, andforcan omit curly braces when they apply to only a single statement. This recipe ensures that any statements which follow that statement are correctly indented to show they are not part of the flow control statement.
- org.openrewrite.staticanalysis.EqualsToContentEquals
- Use
String.contentEquals(CharSequence)instead ofString.equals(CharSequence.toString()) - Use
String.contentEquals(CharSequence)instead ofString.equals(CharSequence.toString()).
- Use
- org.openrewrite.staticanalysis.ExplicitCharsetOnStringGetBytes
- Set charset encoding explicitly when calling
String#getBytes - This makes the behavior of the code platform neutral. It will not override any existing explicit encodings, even if they don't match the default encoding option.
- Set charset encoding explicitly when calling
- org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes
- Use explicit types on lambda arguments
- Adds explicit types on lambda arguments, which are otherwise optional. This can make the code clearer and easier to read. This does not add explicit types on arguments when the lambda has one or two parameters and does not have a block body, as things are considered more readable in those cases. For example,
stream.map((a, b) -> a.length);will not have explicit types added.
- org.openrewrite.staticanalysis.FinalizeLocalVariables
- Finalize local variables
- Adds the
finalmodifier keyword to local variables which are not reassigned.
- org.openrewrite.staticanalysis.FinalizeMethodArguments
- Finalize method arguments
- Adds the
finalmodifier keyword to method parameters.
- org.openrewrite.staticanalysis.HiddenField
- Hidden field
- Refactor local variables or parameters which shadow a field defined in the same class.
- org.openrewrite.staticanalysis.LowercasePackage
- Rename packages to lowercase
- By convention all Java package names should contain only lowercase letters, numbers, and dashes. This recipe converts any uppercase letters in package names to be lowercase.
- org.openrewrite.staticanalysis.MaskCreditCardNumbers
- Mask credit card numbers
- When encountering string literals which appear to be credit card numbers, mask the last eight digits with the letter 'X'.
- org.openrewrite.staticanalysis.MoveConditionsToWhile
- Convert
while (true)with initialifbreak to loop condition - Simplifies
while (true)loops where the first statement is anifstatement that only contains abreak. The condition is inverted and moved to the loop condition for better readability.
- Convert
- org.openrewrite.staticanalysis.NoFinalizedLocalVariables
- Don't use final on local variables
- Remove the
finalmodifier keyword from local variables regardless of whether they are used within a local class or an anonymous class.
- org.openrewrite.staticanalysis.OnlyCatchDeclaredExceptions
- Replace
catch(Exception)with specific declared exceptions thrown in the try block - Replaces
catch(Exception e)blocks with a multi-catch block (catch (SpecificException1 | SpecificException2 e)) containing only the exceptions declared thrown by method or constructor invocations within thetryblock that are not already caught by more specificcatchclauses.
- Replace
- org.openrewrite.staticanalysis.PreferEqualityComparisonOverDifferenceCheck
- Prefer direct comparison of numbers
- Replace
a - b == 0witha == b,a - b != 0witha != b,a - b < 0witha < b, and similar transformations for all comparison operators to improve readability and avoid overflow issues.
- org.openrewrite.staticanalysis.PreferIncrementOperator
- Prefer increment/decrement and compound assignment operators
- Prefer the use of increment and decrement operators (
++,--,+=,-=) over their more verbose equivalents.
- org.openrewrite.staticanalysis.ReferentialEqualityToObjectEquals
- Replace referential equality operators with Object equals method invocations when the operands both override
Object.equals(Object obj) - Using
==or!=compares object references, not the equality of two objects. This modifies code where both sides of a binary operation (==or!=) overrideObject.equals(Object obj)except when the comparison is within an overriddenObject.equals(Object obj)method declaration itself. The resulting transformation must be carefully reviewed since any modifications change the program's semantics.
- Replace referential equality operators with Object equals method invocations when the operands both override
- org.openrewrite.staticanalysis.RemoveCallsToObjectFinalize
- Remove
Object.finalize()invocations - Remove calls to
Object.finalize(). This method is called during garbage collection and calling it manually is misleading.
- Remove
- org.openrewrite.staticanalysis.RemoveCallsToSystemGc
- Remove garbage collection invocations
- Removes calls to
System.gc()andRuntime.gc(). When to invoke garbage collection is best left to the JVM.
- org.openrewrite.staticanalysis.RemoveEmptyJavaDocParameters
- Remove JavaDoc
@param,@return, and@throwswith no description - Removes
@param,@return, and@throwswith no description from JavaDocs.
- Remove JavaDoc
- org.openrewrite.staticanalysis.RemoveHashCodeCallsFromArrayInstances
hashCode()should not be called on array instances- Replace
hashCode()calls on arrays withArrays.hashCode()because the results fromhashCode()are not helpful.
- org.openrewrite.staticanalysis.RemoveInstanceOfPatternMatch
- Removes from code Java 14's
instanceofpattern matching - Adds an explicit variable declaration at the beginning of
ifstatement instead ofinstanceofpattern matching.
- Removes from code Java 14's
- org.openrewrite.staticanalysis.RemoveJavaDocAuthorTag
- Remove author tags from JavaDocs
- Removes author tags from JavaDocs to reduce code maintenance.
- org.openrewrite.staticanalysis.RemoveRedundantTypeCast
- Remove redundant casts
- Removes unnecessary type casts. Does not currently check casts in lambdas and class constructors.
- org.openrewrite.staticanalysis.RemoveToStringCallsFromArrayInstances
- Remove
toString()calls on arrays - The result from
toString()calls on arrays is largely useless. The output does not actually reflect the contents of the array.Arrays.toString(array)should be used instead as it gives the contents of the array.
- Remove
- org.openrewrite.staticanalysis.RemoveUnneededAssertion
- Remove unneeded assertions
- Remove unneeded assertions like
assert true,assertTrue(true), orassertFalse(false).
- org.openrewrite.staticanalysis.RemoveUnneededBlock
- Remove unneeded block
- Flatten blocks into inline statements when possible.
- org.openrewrite.staticanalysis.RenameExceptionInEmptyCatch
- Rename caught exceptions in empty catch blocks to
ignored - Renames caught exceptions in empty catch blocks to
ignored.ignoredwill be incremented by 1 if a namespace conflict exists.
- Rename caught exceptions in empty catch blocks to
- org.openrewrite.staticanalysis.RenameLocalVariablesToCamelCase
- Reformat local variable names to camelCase
- Reformat local variable and method parameter names to camelCase to comply with Java naming convention. The recipe will not rename variables declared in for loop controls or catches with a single character. The first character is set to lower case and existing capital letters are preserved. Special characters that are allowed in java field names
$and_are removed (unless the name starts with one). If a special character is removed the next valid alphanumeric will be capitalized. Currently, does not support renaming members of classes. The recipe will not rename a variable if the result already exists in the class, conflicts with a java reserved keyword, or the result is blank.
- org.openrewrite.staticanalysis.RenamePrivateFieldsToCamelCase
- Reformat private field names to camelCase
- Reformat private field names to camelCase to comply with Java naming convention. The recipe will not rename fields with default, protected or public access modifiers. The recipe will not rename private constants. The first character is set to lower case and existing capital letters are preserved. Special characters that are allowed in java field names
$and_are removed. If a special character is removed the next valid alphanumeric will be capitalized. The recipe will not rename a field if the result already exists in the class, conflicts with a java reserved keyword, or the result is blank.
- org.openrewrite.staticanalysis.ReorderAnnotationAttributes
- Reorder annotation attributes alphabetically
- Reorder annotation attributes to be alphabetical. Positional arguments (those without explicit attribute names) are left in their original position.
- org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray
- Use Empty Array for
Collection.toArray() - Changes new array creation with
Collection#toArray(T[])to use an empty array argument, which is better for performance. According to theCollection#toArray(T[])documentation: > If the collection fits in the specified array, it is returned therein. However, although it's not intuitive, allocating a right-sized array ahead of time to pass to the API appears to be generally worse for performance according to benchmarking and JVM developers due to a number of implementation details in both Java and the virtual machine. H2 achieved significant performance gains by switching to empty arrays instead pre-sized ones.
- Use Empty Array for
- org.openrewrite.staticanalysis.ReplaceDuplicateStringLiterals
- Replace duplicate
Stringliterals - Replaces
Stringliterals with a length of 5 or greater repeated a minimum of 3 times. QualifiedStringliterals include final Strings, method invocations, and new class invocations. Adds a newprivate static final Stringor uses an existing equivalent class field. A new variable name will be generated based on the literal value if an existing field does not exist. The generated name will append a numeric value to the variable name if a name already exists in the compilation unit.
- Replace duplicate
- org.openrewrite.staticanalysis.ReplaceOptionalIsPresentWithIfPresent
- Replace
Optional#isPresent()withOptional#ifPresent() - Replace
Optional#isPresent()withOptional#ifPresent(). Please note that this recipe is only suitable for if-blocks that lack an Else-block and have a single condition applied.
- Replace
- org.openrewrite.staticanalysis.ReplaceRedundantFormatWithPrintf
- Replace redundant String format invocations that are wrapped with PrintStream operations
- Replaces
PrintStream.print(String.format(format, ...args))withPrintStream.printf(format, ...args)(and forprintln, appends a newline to the format string).
- org.openrewrite.staticanalysis.ReplaceStackWithDeque
- Replace
java.util.Stackwithjava.util.Deque - From the Javadoc of
Stack: > A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class.
- Replace
- org.openrewrite.staticanalysis.ReplaceTextBlockWithString
- Replace text block with regular string
- Replace text block with a regular multi-line string.
- org.openrewrite.staticanalysis.ReplaceWeekYearWithYear
- Week Year (YYYY) should not be used for date formatting
- For most dates Week Year (YYYY) and Year (yyyy) yield the same results. However, on the last week of December and the first week of January, Week Year could produce unexpected results.
- org.openrewrite.staticanalysis.SimplifyBooleanExpressionWithDeMorgan
- Simplify boolean expressions using De Morgan's laws
- Applies De Morgan's laws to simplify boolean expressions with negation. Transforms
!(a && b)to!a || !band!(a || b)to!a && !b.
- org.openrewrite.staticanalysis.SimplifyCompoundStatement
- Simplify compound statement
- Fixes or removes useless compound statements. For example, removing
b &= true, and replacingb &= falsewithb = false.
- org.openrewrite.staticanalysis.SimplifyConsecutiveAssignments
- Simplify consecutive assignments
- Combine consecutive assignments into a single statement where possible.
- org.openrewrite.staticanalysis.SimplifyDurationCreationUnits
- Simplify
java.time.Durationunits - Simplifies
java.time.Durationunits to be more human-readable.
- Simplify
- org.openrewrite.staticanalysis.SimplifyElseBranch
- Simplify
elsebranch if it only has a singleif - Simplify
elsebranch if it only has a singleif.
- Simplify
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes
- Simplify ternary expressions
- Simplifies various types of ternary expressions to improve code readability.
- org.openrewrite.staticanalysis.SortedSetStreamToLinkedHashSet
- Sorted set stream should be collected to LinkedHashSet
- Converts
set.stream().sorted().collect(Collectors.toSet())toset.stream().sorted().collect(LinkedHashSet::new).
- org.openrewrite.staticanalysis.TernaryOperatorsShouldNotBeNested
- Ternary operators should not be nested
- Nested ternary operators can be hard to read quickly. Prefer simpler constructs for improved readability. If supported, this recipe will try to replace nested ternaries with switch expressions.
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
- URL Equals and Hash Code
- Uses of
equals()andhashCode()causejava.net.URLto make blocking internet connections. Instead, usejava.net.URI.
- org.openrewrite.staticanalysis.UnwrapRepeatableAnnotations
- Unwrap
@Repeatableannotations - Java 8 introduced the concept of
@Repeatableannotations, making the wrapper annotation unnecessary.
- Unwrap
- org.openrewrite.staticanalysis.UseAsBuilder
- Chain calls to builder methods
- Chain calls to builder methods that are on separate lines into one chain of builder calls.
- org.openrewrite.staticanalysis.UseCollectionInterfaces
- Use
Collectioninterfaces - Use
Deque,List,Map,ConcurrentMap,Queue, andSetinstead of implemented collections. Replaces the return type of public method declarations and the variable type public variable declarations.
- Use
- org.openrewrite.staticanalysis.UseForEachRemoveInsteadOfSetRemoveAll
- Replace
java.util.Set#removeAll(java.util.Collection)withjava.util.Collection#forEach(Set::remove) - Using
java.util.Collection#forEach(Set::remove)rather thanjava.util.Set#removeAll(java.util.Collection)may improve performance due to a possible O(n^2) complexity.
- Replace
- org.openrewrite.staticanalysis.UseLambdaForFunctionalInterface
- Use lambda expressions instead of anonymous classes
- Instead of anonymous class declarations, use a lambda where possible. Using lambdas to replace anonymous classes can lead to more expressive and maintainable code, improve code readability, reduce code duplication, and achieve better performance in some cases.
- org.openrewrite.staticanalysis.UseListSort
- Replace invocations of
Collections#sort(List, Comparator)withList#sort(Comparator) - The
java.util.Collections#sort(..)implementation defers to thejava.util.List#sort(Comparator), replaced it with thejava.util.List#sort(Comparator)implementation for better readability.
- Replace invocations of
- org.openrewrite.staticanalysis.UseObjectNotifyAll
- Replaces
Object.notify()withObject.notifyAll() Object.notifyAll()andObject.notify()both wake up sleeping threads, butObject.notify()only rouses one whileObject.notifyAll()rouses all of them. SinceObject.notify()might not wake up the right thread,Object.notifyAll()should be used instead. See this for more information.
- Replaces
- org.openrewrite.staticanalysis.UseStandardCharset
- Use
StandardCharsetconstants - Replaces
Charset.forName(java.lang.String)with the equivalentStandardCharsetconstant.
- Use
- org.openrewrite.staticanalysis.UseStringReplace
- Use
String::replace()when first parameter is not a real regular expression - When
String::replaceAllis used, the first argument should be a real regular expression. If it’s not the case,String::replacedoes exactly the same thing asString::replaceAllwithout the performance drawback of the regex.
- Use
- org.openrewrite.staticanalysis.UseSystemLineSeparator
- Use
System.lineSeparator() - Replace calls to
System.getProperty("line.separator")withSystem.lineSeparator().
- Use
- org.openrewrite.staticanalysis.maven.MavenJavadocNonAsciiRecipe
- Remove non-ASCII characters from Javadoc
- Maven's javadoc-plugin configuration does not support non-ASCII characters. What makes it tricky is the error is very ambiguous and doesn't help in any way. This recipe removes those non-ASCII characters.
rewrite-struts
- org.openrewrite.java.struts.search.FindStrutsActions
- Find Struts actions
- Find actions and their associated definitions.
- org.openrewrite.java.struts.search.FindStrutsXml
- Find struts XML files
- Struts XML files may have any name, and may be outside a resources directory, so the true test is to look at the content of the file.
rewrite-terraform
- org.openrewrite.terraform.SecureRandom
- Use a long enough byte length for
randomresources - Use a long enough byte length for
randomresources.
- Use a long enough byte length for
- org.openrewrite.terraform.search.FindRequiredProvider
- Find required providers
- Find
required_providersblocks in Terraform configuration files. Produces a data table of the provider names and their versions.
- org.openrewrite.terraform.search.FindResource
- Find Terraform resource
- Find a Terraform resource by resource type.
rewrite-testing-frameworks
- org.openrewrite.java.testing.cleanup.RemoveEmptyTests
- Remove empty tests without comments
- Removes empty methods with a
@Testannotation if the body does not have comments.
- org.openrewrite.java.testing.mockito.AnyStringToNullable
- Replace Mockito 1.x
anyString()withnullable(String.class) - Since Mockito 2.10
anyString()no longer matches null values. Usenullable(Class)instead.
- Replace Mockito 1.x
- org.openrewrite.java.testing.mockito.CloseUnclosedStaticMocks
- Close unclosed static mocks
- Ensures that all
mockStaticcalls are properly closed. IfmockStaticis in lifecycle methods like@BeforeEachor@BeforeAll, creates a class variable and closes it in@AfterEachor@AfterAll. IfmockStaticis inside a test method, wraps it in a try-with-resources block.
- org.openrewrite.java.testing.mockito.MockitoJUnitRunnerSilentToExtension
- JUnit 4 MockitoJUnitRunner.Silent to JUnit Jupiter MockitoExtension with LENIENT settings
- Replace
@RunWith(MockitoJUnitRunner.Silent.class)with@ExtendWith(MockitoExtension.class)and@MockitoSettings(strictness = Strictness.LENIENT).
rewrite-third-party
- com.oracle.weblogic.rewrite.JakartaEE9_1
- Migrate to Jakarta EE 9.1
- These recipes help with Migration to Jakarta EE 9.1, flagging and updating deprecated methods.
- com.oracle.weblogic.rewrite.UpgradeTo1411
- Migrate to WebLogic 14.1.1
- This recipe will apply changes required for migrating to WebLogic 14.1.1
- com.oracle.weblogic.rewrite.UpgradeTo1412
- Migrate to WebLogic 14.1.2
- This recipe will apply changes required for migrating to WebLogic 14.1.2
- com.oracle.weblogic.rewrite.UpgradeTo1511
- Migrate to WebLogic 15.1.1
- This recipe will apply changes required for migrating to WebLogic 15.1.1 and Jakarta EE 9.1
- com.oracle.weblogic.rewrite.WebLogicXmlCreateIfNotExists1511
- Create
weblogic.xmlif it does not exist - This recipe will create a
weblogic.xmlfile with the WebLogic 15.1.1 namespace if it does not already exist.
- Create
- com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesJPA
- Add
prefer-application-packagesfor JPA inweblogic.xml - This recipe will add a
prefer-application-packagesentry for Jakarta Persistence inweblogic.xmlif it does not already exist.
- Add
- com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesSlf4j
- Add
prefer-application-packagesfor SLF4J inweblogic.xml - This recipe will add a
prefer-application-packagesentry for SLF4J inweblogic.xmlif it does not already exist.
- Add
- com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511
- Add WebLogic 15.1.1 PetClinic extras
- Run migration extras for migrated Spring Framework PetClinic example run on WebLogic 15.1.1.
- com.oracle.weblogic.rewrite.examples.spring.SetupSpringFrameworkPetClinicFor1412
- Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2
- Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2.
- com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9
- Migrate to Hibernate for Jakarta EE 9
- Upgrade hibernate libraries to Jakarta EE9 versions.
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo31
- Update Jakarta Persistence to 3.1
- Update Jakarta Persistence to 3.1.
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo32
- Update Jakarta Persistence to 3.2
- Update Jakarta Persistence to 3.2.
- com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2
- Migrate to Spring Framework 6.2 for WebLogic 15.1.1
- Migrate applications to the Spring Framework 6.2 release and compatibility with WebLogic 15.1.1.
- org.apache.camel.upgrade.Camel410LTSMigrationRecipe
- Migrate to 4.10.6
- Migrates Apache Camel application to 4.10.6.
- org.apache.camel.upgrade.CamelMigrationRecipe
- Migrate to 4.14.0
- Migrates Apache Camel application to 4.14.0.
rewrite-toml
- org.openrewrite.toml.ChangeKey
- Change TOML key
- Change a TOML key, while leaving the value intact.
- org.openrewrite.toml.ChangeTableRowValue
- Change TOML table row value
- Change a value in a TOML table row when the identifying property matches the specified matcher.
- org.openrewrite.toml.ChangeValue
- Change TOML value
- Change the value of a TOML key.
- org.openrewrite.toml.CreateTomlFile
- Create TOML file
- Create a new TOML file.
- org.openrewrite.toml.DeleteKey
- Delete TOML key
- Delete a TOML key-value pair.
- org.openrewrite.toml.DeleteTable
- Delete TOML table
- Delete a TOML table.
- org.openrewrite.toml.DeleteTableRow
- Delete TOML table row
- Delete a TOML table row when one of its values matches the specified matcher.
- org.openrewrite.toml.FindKey
- Find TOML keys
- Find TOML keys matching a path expression.
- org.openrewrite.toml.MergeTableRow
- Merge TOML table row
- Merge a TOML row into an array table. If a row with the same identifying property exists, merge the values. Otherwise, insert a new row.
- org.openrewrite.toml.ReplaceTableRow
- Replace TOML table row
- Replace a TOML table row with new content. If a row with the same identifying property exists, replace it entirely.
rewrite-vulncheck
- io.moderne.vulncheck.FixVulnCheckVulnerabilities
- Use VulnCheck Exploit Intelligence to fix vulnerabilities
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe by default only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this can be controlled using the
maximumUpgradeDeltaoption. Vulnerability information comes from VulnCheck Vulnerability Intelligence. The recipe has an option to limit fixes to only those vulnerabilities that have evidence of exploitation at various levels of severity.
rewrite-xml
- org.openrewrite.xml.AddCommentToXmlTag
- Add a comment to an XML tag
- Adds a comment as the first element in an XML tag.
- org.openrewrite.xml.AddTagAttribute
- Add new XML attribute for an Element
- Add new XML attribute with value on a specified element.
- org.openrewrite.xml.RemoveEmptyXmlTags
- Remove empty XML Tag
- Removes XML tags that do not have attributes or children, including self closing tags.
- org.openrewrite.xml.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.xml.XsltTransformation
- XSLT transformation
- Apply the specified XSLT transformation on matching files. Note that there are no format matching guarantees when running this recipe.
- org.openrewrite.xml.format.AutoFormat
- Format XML
- Indents XML using the most common indentation size and tabs or space choice in use in the file.
- org.openrewrite.xml.format.LineBreaks
- Blank lines
- Add line breaks at appropriate places between XML syntax elements.
- org.openrewrite.xml.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.xml.format.NormalizeLineBreaks
- Normalize line breaks
- Consistently use either Windows style (CRLF) or Linux style (LF) line breaks. If no
GeneralFormatStyleis specified this will use whichever style of line endings are more common.
- org.openrewrite.xml.format.NormalizeTabsOrSpaces
- Normalize to tabs or spaces
- Consistently use either tabs or spaces in indentation.
- org.openrewrite.xml.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in XML code.
- org.openrewrite.xml.search.DoesNotUseNamespaceUri
- Find files without Namespace URI
- Find XML root elements that do not have a specific Namespace URI, optionally restricting the search by an XPath expression.
- org.openrewrite.xml.search.FindNamespacePrefix
- Find XML namespace prefixes
- Find XML namespace prefixes, optionally restricting the search by a XPath expression.
- org.openrewrite.xml.search.FindTags
- Find XML tags
- Find XML tags by XPath expression.
- org.openrewrite.xml.search.HasNamespaceUri
- Find XML namespace URIs
- Find XML namespace URIs, optionally restricting the search by a XPath expression.
- org.openrewrite.xml.security.AddOwaspDateBoundSuppressions
- Add date bounds to OWASP suppressions
- Adds an expiration date to all OWASP suppressions in order to ensure that they are periodically reviewed. For use with the OWASP
dependency-checktool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
- org.openrewrite.xml.security.IsOwaspSuppressionsFile
- Find OWASP vulnerability suppression XML files
- These files are used to suppress false positives in OWASP Dependency Check.
- org.openrewrite.xml.security.RemoveOwaspSuppressions
- Remove out-of-date OWASP suppressions
- Remove all OWASP suppressions with a suppression end date in the past, as these are no longer valid. For use with the OWASP
dependency-checktool. More details on OWASP suppression files can be found here.
- org.openrewrite.xml.security.UpdateOwaspSuppressionDate
- Update OWASP suppression date bounds
- Updates the expiration date for OWASP suppressions having a matching cve tag. For use with the OWASP
dependency-checktool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
- org.openrewrite.xml.style.AutodetectDebug
- XML style Auto-detection debug
- Runs XML Autodetect and records the results in data tables and search markers. A debugging tool for figuring out why XML documents get styled the way they do.
rewrite-yaml
- org.openrewrite.yaml.AppendToSequence
- Append to sequence
- Append item to YAML sequence.
- org.openrewrite.yaml.ChangePropertyValue
- Change YAML property
- Change a YAML property. Expects dot notation for nested YAML mappings, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.CoalesceProperties
- Coalesce YAML properties
- Simplify nested map hierarchies into their simplest dot separated property form, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.CreateYamlFile
- Create YAML file
- Create a new YAML file.
- org.openrewrite.yaml.UnfoldProperties
- Unfold YAML properties
- Transforms dot-separated property keys in YAML files into nested map hierarchies to enhance clarity and readability, or for compatibility with tools expecting structured YAML.
- org.openrewrite.yaml.format.Indents
- YAML indent
- Format tabs and indents in YAML.