diff --git a/docs/changelog/8-59-1-Release.md b/docs/changelog/8-59-1-Release.md index 1465e388b6..0ef745160a 100644 --- a/docs/changelog/8-59-1-Release.md +++ b/docs/changelog/8-59-1-Release.md @@ -4,7 +4,7 @@ description: What's changed in OpenRewrite version 8.59.1. # 8.59.1 release (2025-07-24) -_Total recipe count: 4006_ +_Total recipe count: 4576_ :::info This changelog only shows what recipes have been added, removed, or changed. OpenRewrite may do releases that do not include these types of changes. To see these changes, please go to the [releases page](https://github.com/openrewrite/rewrite/releases). diff --git a/docs/recipes/csharp/README.md b/docs/recipes/csharp/README.md index d9bc7ec7d4..39f69bd7d9 100644 --- a/docs/recipes/csharp/README.md +++ b/docs/recipes/csharp/README.md @@ -5,5 +5,6 @@ _Recipes for C# codebases._ ## Categories * [Dependencies](/recipes/csharp/dependencies) +* [Recipes](/recipes/csharp/recipes) diff --git a/docs/recipes/csharp/recipes/README.md b/docs/recipes/csharp/recipes/README.md new file mode 100644 index 0000000000..bb11a34489 --- /dev/null +++ b/docs/recipes/csharp/recipes/README.md @@ -0,0 +1,11 @@ +# Recipes + +## Categories + +* [Meziantou](/recipes/csharp/recipes/meziantou) +* [Microsoft](/recipes/csharp/recipes/microsoft) +* [Roslynator](/recipes/csharp/recipes/roslynator) +* [Stylecop](/recipes/csharp/recipes/stylecop) +* [Wpfanalyzers](/recipes/csharp/recipes/wpfanalyzers) + + diff --git a/docs/recipes/csharp/recipes/meziantou/README.md b/docs/recipes/csharp/recipes/meziantou/README.md new file mode 100644 index 0000000000..f3d23765ed --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/README.md @@ -0,0 +1,7 @@ +# Meziantou + +## Categories + +* [Analyzer](/recipes/csharp/recipes/meziantou/analyzer) + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/README.md b/docs/recipes/csharp/recipes/meziantou/analyzer/README.md new file mode 100644 index 0000000000..bcfb385411 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/README.md @@ -0,0 +1,72 @@ +# Analyzer + +## Recipes + +* [A class that provides Equals(T) should implement IEquatable](./equalityshouldbecorrectlyimplementedma0077.md) +* [Abstract types should not have public or internal constructors](./abstracttypesshouldnothaveconstructorsma0017.md) +* [Add StructLayoutAttribute](./usestructlayoutattributema0008.md) +* [Add a comma after the last value](./commama0007.md) +* [Add parameter name to improve readability](./namedparameterma0003.md) +* [Avoid comparison with bool constant](./avoidcomparisonwithboolconstantma0073.md) +* [Avoid implicit culture-sensitive methods](./usestringcomparisonma0074.md) +* [Avoid using redundant else](./avoidusingredundantelsema0071.md) +* [Combine LINQ methods](./optimizelinqusagema0029.md) +* [Do not use blocking calls in a sync method (need to make calling method async)](./donotuseblockingcallinasynccontextma0045.md) +* [Do not use blocking calls in an async method](./donotuseblockingcallinasynccontextma0042.md) +* [EventArgs should not be null](./useeventargsemptyma0093.md) +* [Forward the CancellationToken parameter to methods that take one](./useanoverloadthathascancellationtokenfixer_argumentma0040.md) +* [Forward the CancellationToken using .WithCancellation()](./useanoverloadthathascancellationtokenfixer_awaitforeachma0079.md) +* [Forward the TimeProvider to methods that take one](./useanoverloadthathastimeproviderma0166.md) +* [IEqualityComparer or IComparer is missing](./usestringcomparerma0002.md) +* [Make class sealed](./classmustbesealedma0053.md) +* [Make class static](./makeclassstaticma0036.md) +* [Make interpolated string](./makeinterpolatedstringma0165.md) +* [Make member readonly](./makememberreadonlyma0102.md) +* [Make method static (deprecated, use CA1822 instead)](./makemethodstaticma0038.md) +* [Make property static (deprecated, use CA1822 instead)](./makemethodstaticma0041.md) +* [Mark attributes with AttributeUsageAttribute](./markattributeswithattributeusageattributema0010.md) +* [Method overrides should not change default values](./methodoverridesshouldnotchangeparameterdefaultsma0061.md) +* [Method overrides should not omit params keyword](./preserveparamsonoverridema0081.md) +* [Optimize Enumerable.Count() usage](./optimizelinqusagema0031.md) +* [Optimize StringBuilder usage](./optimizestringbuilderusagema0028.md) +* [Optimize string method usage](./optimizestartswithma0089.md) +* [Parameters with [EditorRequired] attributes should also be marked as [Parameter]](./parameterattributeforrazorcomponentma0117.md) +* [Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter]](./parameterattributeforrazorcomponentma0116.md) +* [Prefer rethrowing an exception implicitly](./donotremoveoriginalexceptionfromthrowstatementma0027.md) +* [Remove empty statement](./removeemptystatementma0037.md) +* [Remove redundant argument value](./simplifycallerargumentexpressionma0108.md) +* [Remove useless OrderBy call](./optimizelinqusagema0030.md) +* [Remove useless ToString call](./removeuselesstostringma0044.md) +* [Replace constant Enum.ToString with nameof](./replaceenumtostringwithnameofma0052.md) +* [Return Task.FromResult instead of returning null](./returntaskfromresultinsteadofreturningnullma0022.md) +* [Sender should be 'this' for instance events](./eventsshouldhaveproperargumentsma0091.md) +* [String contains an implicit end of line character](./stringshouldnotcontainsnondeterministicendoflinema0101.md) +* [StringComparison is missing](./usestringcomparisonma0001.md) +* [Use 'Cast' instead of 'Select' to cast](./optimizelinqusagema0078.md) +* [Use 'Order' instead of 'OrderBy'](./optimizelinqusagema0159.md) +* [Use 'is' operator instead of SequenceEqual](./useispatterninsteadofsequenceequalma0128.md) +* [Use Array.Empty()](./usearrayemptyma0005.md) +* [Use DateTime.UnixEpoch](./usedatetimeunixepochma0113.md) +* [Use DateTimeOffset.UnixEpoch](./usedatetimeunixepochma0114.md) +* [Use EventArgs.Empty](./useeventargsemptyma0019.md) +* [Use Guid.Empty](./useguidemptyma0067.md) +* [Use InvokeVoidAsync when the returned value is not used](./usejsruntimeinvokevoidasyncwhenreturnvalueisnotusedma0120.md) +* [Use SequenceEqual instead of equality operator](./donotuseequalityoperatorsforspanofcharma0103.md) +* [Use String.Equals instead of equality operator](./usestringequalsma0006.md) +* [Use StringComparer.GetHashCode instead of string.GetHashCode](./donotusestringgethashcodema0021.md) +* [Use Task.ConfigureAwait](./useconfigureawaitma0004.md) +* [Use an explicit StringComparer when possible](./donotuseequalitycomparerdefaultofstringma0024.md) +* [Use direct methods instead of LINQ methods](./optimizelinqusagema0020.md) +* [Use indexer instead of LINQ methods](./optimizelinqusagema0098.md) +* [Use langword in XML comment](./uselangwordinxmlcommentma0154.md) +* [Use nameof operator in ArgumentException](./argumentexceptionshouldspecifyargumentnamema0043.md) +* [Use parentheses to make not pattern clearer](./notpatternshouldbeparenthesizedcodema0164.md) +* [Use pattern matching instead of equality operators for discrete value](./usepatternmatchingforequalitycomparisonsma0148.md) +* [Use pattern matching instead of equality operators for null check](./usepatternmatchingforequalitycomparisonsma0142.md) +* [Use pattern matching instead of inequality operators for discrete value](./usepatternmatchingforequalitycomparisonsma0149.md) +* [Use pattern matching instead of inequality operators for null check](./usepatternmatchingforequalitycomparisonsma0141.md) +* [Use string.Create instead of FormattableString](./usestringcreateinsteadofformattablestringma0111.md) +* [Use the Regex source generator](./useregexsourcegeneratorma0110.md) +* [Validate arguments correctly in iterator methods](./validateargumentscorrectlyma0050.md) + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/abstracttypesshouldnothaveconstructorsma0017.md b/docs/recipes/csharp/recipes/meziantou/analyzer/abstracttypesshouldnothaveconstructorsma0017.md new file mode 100644 index 0000000000..c403f10e28 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/abstracttypesshouldnothaveconstructorsma0017.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Abstract types should not have public or internal constructors" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Abstract types should not have public or internal constructors + +**org.openrewrite.csharp.recipes.meziantou.analyzer.AbstractTypesShouldNotHaveConstructorsMA0017** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/AbstractTypesShouldNotHaveConstructorsMA0017.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AbstractTypesShouldNotHaveConstructorsMA0017 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/argumentexceptionshouldspecifyargumentnamema0043.md b/docs/recipes/csharp/recipes/meziantou/analyzer/argumentexceptionshouldspecifyargumentnamema0043.md new file mode 100644 index 0000000000..f65a424184 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/argumentexceptionshouldspecifyargumentnamema0043.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use nameof operator in ArgumentException" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use nameof operator in ArgumentException + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ArgumentExceptionShouldSpecifyArgumentNameMA0043** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ArgumentExceptionShouldSpecifyArgumentNameMA0043.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ArgumentExceptionShouldSpecifyArgumentNameMA0043 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/avoidcomparisonwithboolconstantma0073.md b/docs/recipes/csharp/recipes/meziantou/analyzer/avoidcomparisonwithboolconstantma0073.md new file mode 100644 index 0000000000..4963b685ef --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/avoidcomparisonwithboolconstantma0073.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid comparison with bool constant" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid comparison with bool constant + +**org.openrewrite.csharp.recipes.meziantou.analyzer.AvoidComparisonWithBoolConstantMA0073** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/AvoidComparisonWithBoolConstantMA0073.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidComparisonWithBoolConstantMA0073 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/avoidusingredundantelsema0071.md b/docs/recipes/csharp/recipes/meziantou/analyzer/avoidusingredundantelsema0071.md new file mode 100644 index 0000000000..e1719dfad1 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/avoidusingredundantelsema0071.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid using redundant else" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid using redundant else + +**org.openrewrite.csharp.recipes.meziantou.analyzer.AvoidUsingRedundantElseMA0071** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/AvoidUsingRedundantElseMA0071.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidUsingRedundantElseMA0071 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/classmustbesealedma0053.md b/docs/recipes/csharp/recipes/meziantou/analyzer/classmustbesealedma0053.md new file mode 100644 index 0000000000..acf27190e4 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/classmustbesealedma0053.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make class sealed" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make class sealed + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ClassMustBeSealedMA0053** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ClassMustBeSealedMA0053.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ClassMustBeSealedMA0053 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/commama0007.md b/docs/recipes/csharp/recipes/meziantou/analyzer/commama0007.md new file mode 100644 index 0000000000..64cdc1d003 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/commama0007.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add a comma after the last value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add a comma after the last value + +**org.openrewrite.csharp.recipes.meziantou.analyzer.CommaMA0007** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/CommaMA0007.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CommaMA0007 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/donotremoveoriginalexceptionfromthrowstatementma0027.md b/docs/recipes/csharp/recipes/meziantou/analyzer/donotremoveoriginalexceptionfromthrowstatementma0027.md new file mode 100644 index 0000000000..3caa98fba5 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/donotremoveoriginalexceptionfromthrowstatementma0027.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Prefer rethrowing an exception implicitly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer rethrowing an exception implicitly + +**org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotRemoveOriginalExceptionFromThrowStatementMA0027** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotRemoveOriginalExceptionFromThrowStatementMA0027.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotRemoveOriginalExceptionFromThrowStatementMA0027 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseblockingcallinasynccontextma0042.md b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseblockingcallinasynccontextma0042.md new file mode 100644 index 0000000000..e54be02ffc --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseblockingcallinasynccontextma0042.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Do not use blocking calls in an async method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use blocking calls in an async method + +**org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseBlockingCallInAsyncContextMA0042** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotUseBlockingCallInAsyncContextMA0042.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseBlockingCallInAsyncContextMA0042 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseblockingcallinasynccontextma0045.md b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseblockingcallinasynccontextma0045.md new file mode 100644 index 0000000000..9003d12fc0 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseblockingcallinasynccontextma0045.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Do not use blocking calls in a sync method (need to make calling method async)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use blocking calls in a sync method (need to make calling method async) + +**org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseBlockingCallInAsyncContextMA0045** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotUseBlockingCallInAsyncContextMA0045.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseBlockingCallInAsyncContextMA0045 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseequalitycomparerdefaultofstringma0024.md b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseequalitycomparerdefaultofstringma0024.md new file mode 100644 index 0000000000..1004d9a492 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseequalitycomparerdefaultofstringma0024.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use an explicit StringComparer when possible" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use an explicit StringComparer when possible + +**org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseEqualityComparerDefaultOfStringMA0024** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotUseEqualityComparerDefaultOfStringMA0024.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseEqualityComparerDefaultOfStringMA0024 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseequalityoperatorsforspanofcharma0103.md b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseequalityoperatorsforspanofcharma0103.md new file mode 100644 index 0000000000..9c406955df --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/donotuseequalityoperatorsforspanofcharma0103.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use SequenceEqual instead of equality operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use SequenceEqual instead of equality operator + +**org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseEqualityOperatorsForSpanOfCharMA0103** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotUseEqualityOperatorsForSpanOfCharMA0103.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseEqualityOperatorsForSpanOfCharMA0103 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/donotusestringgethashcodema0021.md b/docs/recipes/csharp/recipes/meziantou/analyzer/donotusestringgethashcodema0021.md new file mode 100644 index 0000000000..4c2a77a137 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/donotusestringgethashcodema0021.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use StringComparer.GetHashCode instead of string.GetHashCode" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use StringComparer.GetHashCode instead of string.GetHashCode + +**org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseStringGetHashCodeMA0021** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotUseStringGetHashCodeMA0021.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseStringGetHashCodeMA0021 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/equalityshouldbecorrectlyimplementedma0077.md b/docs/recipes/csharp/recipes/meziantou/analyzer/equalityshouldbecorrectlyimplementedma0077.md new file mode 100644 index 0000000000..9338711f33 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/equalityshouldbecorrectlyimplementedma0077.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "A class that provides Equals(T) should implement IEquatable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# A class that provides Equals(T) should implement IEquatable<T> + +**org.openrewrite.csharp.recipes.meziantou.analyzer.EqualityShouldBeCorrectlyImplementedMA0077** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/EqualityShouldBeCorrectlyImplementedMA0077.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EqualityShouldBeCorrectlyImplementedMA0077 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/eventsshouldhaveproperargumentsma0091.md b/docs/recipes/csharp/recipes/meziantou/analyzer/eventsshouldhaveproperargumentsma0091.md new file mode 100644 index 0000000000..1c98e03752 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/eventsshouldhaveproperargumentsma0091.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Sender should be 'this' for instance events" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Sender should be 'this' for instance events + +**org.openrewrite.csharp.recipes.meziantou.analyzer.EventsShouldHaveProperArgumentsMA0091** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/EventsShouldHaveProperArgumentsMA0091.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EventsShouldHaveProperArgumentsMA0091 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/makeclassstaticma0036.md b/docs/recipes/csharp/recipes/meziantou/analyzer/makeclassstaticma0036.md new file mode 100644 index 0000000000..1acebf2ec2 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/makeclassstaticma0036.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make class static" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make class static + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MakeClassStaticMA0036** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MakeClassStaticMA0036.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeClassStaticMA0036 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/makeinterpolatedstringma0165.md b/docs/recipes/csharp/recipes/meziantou/analyzer/makeinterpolatedstringma0165.md new file mode 100644 index 0000000000..41223eb3e3 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/makeinterpolatedstringma0165.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make interpolated string" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make interpolated string + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MakeInterpolatedStringMA0165** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MakeInterpolatedStringMA0165.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeInterpolatedStringMA0165 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/makememberreadonlyma0102.md b/docs/recipes/csharp/recipes/meziantou/analyzer/makememberreadonlyma0102.md new file mode 100644 index 0000000000..ddfc5c1647 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/makememberreadonlyma0102.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make member readonly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make member readonly + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMemberReadOnlyMA0102** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MakeMemberReadOnlyMA0102.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeMemberReadOnlyMA0102 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/makemethodstaticma0038.md b/docs/recipes/csharp/recipes/meziantou/analyzer/makemethodstaticma0038.md new file mode 100644 index 0000000000..eb3f3ece97 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/makemethodstaticma0038.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make method static (deprecated, use CA1822 instead)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make method static (deprecated, use CA1822 instead) + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMethodStaticMA0038** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MakeMethodStaticMA0038.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeMethodStaticMA0038 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/makemethodstaticma0041.md b/docs/recipes/csharp/recipes/meziantou/analyzer/makemethodstaticma0041.md new file mode 100644 index 0000000000..5a9cc83d4c --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/makemethodstaticma0041.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make property static (deprecated, use CA1822 instead)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make property static (deprecated, use CA1822 instead) + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMethodStaticMA0041** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MakeMethodStaticMA0041.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeMethodStaticMA0041 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/markattributeswithattributeusageattributema0010.md b/docs/recipes/csharp/recipes/meziantou/analyzer/markattributeswithattributeusageattributema0010.md new file mode 100644 index 0000000000..639f570525 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/markattributeswithattributeusageattributema0010.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Mark attributes with AttributeUsageAttribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark attributes with AttributeUsageAttribute + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MarkAttributesWithAttributeUsageAttributeMA0010** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MarkAttributesWithAttributeUsageAttributeMA0010.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MarkAttributesWithAttributeUsageAttributeMA0010 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/methodoverridesshouldnotchangeparameterdefaultsma0061.md b/docs/recipes/csharp/recipes/meziantou/analyzer/methodoverridesshouldnotchangeparameterdefaultsma0061.md new file mode 100644 index 0000000000..c5df7faf0c --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/methodoverridesshouldnotchangeparameterdefaultsma0061.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Method overrides should not change default values" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Method overrides should not change default values + +**org.openrewrite.csharp.recipes.meziantou.analyzer.MethodOverridesShouldNotChangeParameterDefaultsMA0061** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/MethodOverridesShouldNotChangeParameterDefaultsMA0061.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MethodOverridesShouldNotChangeParameterDefaultsMA0061 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/namedparameterma0003.md b/docs/recipes/csharp/recipes/meziantou/analyzer/namedparameterma0003.md new file mode 100644 index 0000000000..91fed937d9 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/namedparameterma0003.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add parameter name to improve readability" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add parameter name to improve readability + +**org.openrewrite.csharp.recipes.meziantou.analyzer.NamedParameterMA0003** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/NamedParameterMA0003.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe NamedParameterMA0003 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/notpatternshouldbeparenthesizedcodema0164.md b/docs/recipes/csharp/recipes/meziantou/analyzer/notpatternshouldbeparenthesizedcodema0164.md new file mode 100644 index 0000000000..a633702924 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/notpatternshouldbeparenthesizedcodema0164.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use parentheses to make not pattern clearer" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use parentheses to make not pattern clearer + +**org.openrewrite.csharp.recipes.meziantou.analyzer.NotPatternShouldBeParenthesizedCodeMA0164** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/NotPatternShouldBeParenthesizedCodeMA0164.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe NotPatternShouldBeParenthesizedCodeMA0164 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0020.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0020.md new file mode 100644 index 0000000000..d1f6de05f4 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0020.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use direct methods instead of LINQ methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use direct methods instead of LINQ methods + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0020** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0020.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0020 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0029.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0029.md new file mode 100644 index 0000000000..c99b84eb4b --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0029.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Combine LINQ methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Combine LINQ methods + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0029** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0029.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0029 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0030.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0030.md new file mode 100644 index 0000000000..7a7db51aa4 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0030.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove useless OrderBy call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove useless OrderBy call + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0030** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0030.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0030 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0031.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0031.md new file mode 100644 index 0000000000..22fd9469b3 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0031.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Optimize Enumerable.Count() usage" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Optimize Enumerable.Count() usage + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0031** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0031.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0031 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0078.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0078.md new file mode 100644 index 0000000000..08ef9fabef --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0078.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'Cast' instead of 'Select' to cast" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'Cast' instead of 'Select' to cast + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0078** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0078.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0078 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0098.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0098.md new file mode 100644 index 0000000000..f91df06a64 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0098.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use indexer instead of LINQ methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use indexer instead of LINQ methods + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0098** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0098.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0098 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0159.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0159.md new file mode 100644 index 0000000000..00367c87c0 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizelinqusagema0159.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'Order' instead of 'OrderBy'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'Order' instead of 'OrderBy' + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0159** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeLinqUsageMA0159.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqUsageMA0159 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizestartswithma0089.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizestartswithma0089.md new file mode 100644 index 0000000000..a484a0b3b6 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizestartswithma0089.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Optimize string method usage" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Optimize string method usage + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeStartsWithMA0089** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeStartsWithMA0089.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeStartsWithMA0089 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/optimizestringbuilderusagema0028.md b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizestringbuilderusagema0028.md new file mode 100644 index 0000000000..d309da6f4e --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/optimizestringbuilderusagema0028.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Optimize StringBuilder usage" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Optimize StringBuilder usage + +**org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeStringBuilderUsageMA0028** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/OptimizeStringBuilderUsageMA0028.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeStringBuilderUsageMA0028 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/parameterattributeforrazorcomponentma0116.md b/docs/recipes/csharp/recipes/meziantou/analyzer/parameterattributeforrazorcomponentma0116.md new file mode 100644 index 0000000000..acc72eee9d --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/parameterattributeforrazorcomponentma0116.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter]" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter] + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ParameterAttributeForRazorComponentMA0116** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ParameterAttributeForRazorComponentMA0116.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterAttributeForRazorComponentMA0116 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/parameterattributeforrazorcomponentma0117.md b/docs/recipes/csharp/recipes/meziantou/analyzer/parameterattributeforrazorcomponentma0117.md new file mode 100644 index 0000000000..8b576d9d39 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/parameterattributeforrazorcomponentma0117.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Parameters with [EditorRequired] attributes should also be marked as [Parameter]" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Parameters with [EditorRequired] attributes should also be marked as [Parameter] + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ParameterAttributeForRazorComponentMA0117** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ParameterAttributeForRazorComponentMA0117.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterAttributeForRazorComponentMA0117 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/preserveparamsonoverridema0081.md b/docs/recipes/csharp/recipes/meziantou/analyzer/preserveparamsonoverridema0081.md new file mode 100644 index 0000000000..02a908ff50 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/preserveparamsonoverridema0081.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Method overrides should not omit params keyword" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Method overrides should not omit params keyword + +**org.openrewrite.csharp.recipes.meziantou.analyzer.PreserveParamsOnOverrideMA0081** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/PreserveParamsOnOverrideMA0081.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PreserveParamsOnOverrideMA0081 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/removeemptystatementma0037.md b/docs/recipes/csharp/recipes/meziantou/analyzer/removeemptystatementma0037.md new file mode 100644 index 0000000000..afcc2ca2af --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/removeemptystatementma0037.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove empty statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove empty statement + +**org.openrewrite.csharp.recipes.meziantou.analyzer.RemoveEmptyStatementMA0037** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/RemoveEmptyStatementMA0037.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveEmptyStatementMA0037 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/removeuselesstostringma0044.md b/docs/recipes/csharp/recipes/meziantou/analyzer/removeuselesstostringma0044.md new file mode 100644 index 0000000000..8f0118ddb0 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/removeuselesstostringma0044.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove useless ToString call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove useless ToString call + +**org.openrewrite.csharp.recipes.meziantou.analyzer.RemoveUselessToStringMA0044** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/RemoveUselessToStringMA0044.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveUselessToStringMA0044 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/replaceenumtostringwithnameofma0052.md b/docs/recipes/csharp/recipes/meziantou/analyzer/replaceenumtostringwithnameofma0052.md new file mode 100644 index 0000000000..ab2602b169 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/replaceenumtostringwithnameofma0052.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Replace constant Enum.ToString with nameof" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Replace constant Enum.ToString with nameof + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ReplaceEnumToStringWithNameofMA0052** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ReplaceEnumToStringWithNameofMA0052.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ReplaceEnumToStringWithNameofMA0052 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/returntaskfromresultinsteadofreturningnullma0022.md b/docs/recipes/csharp/recipes/meziantou/analyzer/returntaskfromresultinsteadofreturningnullma0022.md new file mode 100644 index 0000000000..c14f2de5a6 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/returntaskfromresultinsteadofreturningnullma0022.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Return Task.FromResult instead of returning null" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Return Task.FromResult instead of returning null + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ReturnTaskFromResultInsteadOfReturningNullMA0022** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ReturnTaskFromResultInsteadOfReturningNullMA0022.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ReturnTaskFromResultInsteadOfReturningNullMA0022 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/simplifycallerargumentexpressionma0108.md b/docs/recipes/csharp/recipes/meziantou/analyzer/simplifycallerargumentexpressionma0108.md new file mode 100644 index 0000000000..c734fc99bf --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/simplifycallerargumentexpressionma0108.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant argument value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant argument value + +**org.openrewrite.csharp.recipes.meziantou.analyzer.SimplifyCallerArgumentExpressionMA0108** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/SimplifyCallerArgumentExpressionMA0108.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SimplifyCallerArgumentExpressionMA0108 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/stringshouldnotcontainsnondeterministicendoflinema0101.md b/docs/recipes/csharp/recipes/meziantou/analyzer/stringshouldnotcontainsnondeterministicendoflinema0101.md new file mode 100644 index 0000000000..dd0b0ebe26 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/stringshouldnotcontainsnondeterministicendoflinema0101.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "String contains an implicit end of line character" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# String contains an implicit end of line character + +**org.openrewrite.csharp.recipes.meziantou.analyzer.StringShouldNotContainsNonDeterministicEndOfLineMA0101** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/StringShouldNotContainsNonDeterministicEndOfLineMA0101.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe StringShouldNotContainsNonDeterministicEndOfLineMA0101 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathascancellationtokenfixer_argumentma0040.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathascancellationtokenfixer_argumentma0040.md new file mode 100644 index 0000000000..1be028a1ba --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathascancellationtokenfixer_argumentma0040.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Forward the CancellationToken parameter to methods that take one" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Forward the CancellationToken parameter to methods that take one + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasCancellationTokenFixer\_ArgumentMA0040** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseAnOverloadThatHasCancellationTokenFixer_ArgumentMA0040.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseAnOverloadThatHasCancellationTokenFixer_ArgumentMA0040 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathascancellationtokenfixer_awaitforeachma0079.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathascancellationtokenfixer_awaitforeachma0079.md new file mode 100644 index 0000000000..db0bd7fc24 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathascancellationtokenfixer_awaitforeachma0079.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Forward the CancellationToken using .WithCancellation()" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Forward the CancellationToken using .WithCancellation() + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasCancellationTokenFixer\_AwaitForEachMA0079** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseAnOverloadThatHasCancellationTokenFixer_AwaitForEachMA0079.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseAnOverloadThatHasCancellationTokenFixer_AwaitForEachMA0079 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathastimeproviderma0166.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathastimeproviderma0166.md new file mode 100644 index 0000000000..efecfc56dc --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useanoverloadthathastimeproviderma0166.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Forward the TimeProvider to methods that take one" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Forward the TimeProvider to methods that take one + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasTimeProviderMA0166** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseAnOverloadThatHasTimeProviderMA0166.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseAnOverloadThatHasTimeProviderMA0166 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usearrayemptyma0005.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usearrayemptyma0005.md new file mode 100644 index 0000000000..eafe7ec6b9 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usearrayemptyma0005.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use Array.Empty()" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use Array.Empty<T>() + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseArrayEmptyMA0005** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseArrayEmptyMA0005.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseArrayEmptyMA0005 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useconfigureawaitma0004.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useconfigureawaitma0004.md new file mode 100644 index 0000000000..f12c7d8044 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useconfigureawaitma0004.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use Task.ConfigureAwait" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use Task.ConfigureAwait + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseConfigureAwaitMA0004** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseConfigureAwaitMA0004.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseConfigureAwaitMA0004 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usedatetimeunixepochma0113.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usedatetimeunixepochma0113.md new file mode 100644 index 0000000000..7ccdf73bca --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usedatetimeunixepochma0113.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use DateTime.UnixEpoch" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use DateTime.UnixEpoch + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseDateTimeUnixEpochMA0113** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseDateTimeUnixEpochMA0113.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseDateTimeUnixEpochMA0113 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usedatetimeunixepochma0114.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usedatetimeunixepochma0114.md new file mode 100644 index 0000000000..01c0bde53c --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usedatetimeunixepochma0114.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use DateTimeOffset.UnixEpoch" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use DateTimeOffset.UnixEpoch + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseDateTimeUnixEpochMA0114** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseDateTimeUnixEpochMA0114.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseDateTimeUnixEpochMA0114 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useeventargsemptyma0019.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useeventargsemptyma0019.md new file mode 100644 index 0000000000..a8c735d43f --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useeventargsemptyma0019.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use EventArgs.Empty" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use EventArgs.Empty + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseEventArgsEmptyMA0019** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseEventArgsEmptyMA0019.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseEventArgsEmptyMA0019 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useeventargsemptyma0093.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useeventargsemptyma0093.md new file mode 100644 index 0000000000..fa00f79cef --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useeventargsemptyma0093.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "EventArgs should not be null" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# EventArgs should not be null + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseEventArgsEmptyMA0093** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseEventArgsEmptyMA0093.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseEventArgsEmptyMA0093 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useguidemptyma0067.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useguidemptyma0067.md new file mode 100644 index 0000000000..b1425e4ce7 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useguidemptyma0067.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use Guid.Empty" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use Guid.Empty + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseGuidEmptyMA0067** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseGuidEmptyMA0067.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseGuidEmptyMA0067 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useispatterninsteadofsequenceequalma0128.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useispatterninsteadofsequenceequalma0128.md new file mode 100644 index 0000000000..6ef7e12275 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useispatterninsteadofsequenceequalma0128.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'is' operator instead of SequenceEqual" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'is' operator instead of SequenceEqual + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseIsPatternInsteadOfSequenceEqualMA0128** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseIsPatternInsteadOfSequenceEqualMA0128.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseIsPatternInsteadOfSequenceEqualMA0128 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usejsruntimeinvokevoidasyncwhenreturnvalueisnotusedma0120.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usejsruntimeinvokevoidasyncwhenreturnvalueisnotusedma0120.md new file mode 100644 index 0000000000..ebc2823646 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usejsruntimeinvokevoidasyncwhenreturnvalueisnotusedma0120.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use InvokeVoidAsync when the returned value is not used" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use InvokeVoidAsync when the returned value is not used + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedMA0120** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedMA0120.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedMA0120 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/uselangwordinxmlcommentma0154.md b/docs/recipes/csharp/recipes/meziantou/analyzer/uselangwordinxmlcommentma0154.md new file mode 100644 index 0000000000..f8a3233dc7 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/uselangwordinxmlcommentma0154.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use langword in XML comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use langword in XML comment + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseLangwordInXmlCommentMA0154** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseLangwordInXmlCommentMA0154.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseLangwordInXmlCommentMA0154 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0141.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0141.md new file mode 100644 index 0000000000..4e9ff4897d --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0141.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use pattern matching instead of inequality operators for null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use pattern matching instead of inequality operators for null check + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0141** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UsePatternMatchingForEqualityComparisonsMA0141.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePatternMatchingForEqualityComparisonsMA0141 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0142.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0142.md new file mode 100644 index 0000000000..fd2ea85950 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0142.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use pattern matching instead of equality operators for null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use pattern matching instead of equality operators for null check + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0142** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UsePatternMatchingForEqualityComparisonsMA0142.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePatternMatchingForEqualityComparisonsMA0142 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0148.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0148.md new file mode 100644 index 0000000000..5fe0393aca --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0148.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use pattern matching instead of equality operators for discrete value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use pattern matching instead of equality operators for discrete value + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0148** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UsePatternMatchingForEqualityComparisonsMA0148.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePatternMatchingForEqualityComparisonsMA0148 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0149.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0149.md new file mode 100644 index 0000000000..6bed79e346 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usepatternmatchingforequalitycomparisonsma0149.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use pattern matching instead of inequality operators for discrete value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use pattern matching instead of inequality operators for discrete value + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0149** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UsePatternMatchingForEqualityComparisonsMA0149.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePatternMatchingForEqualityComparisonsMA0149 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/useregexsourcegeneratorma0110.md b/docs/recipes/csharp/recipes/meziantou/analyzer/useregexsourcegeneratorma0110.md new file mode 100644 index 0000000000..c6eb2fb36d --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/useregexsourcegeneratorma0110.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use the Regex source generator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use the Regex source generator + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseRegexSourceGeneratorMA0110** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseRegexSourceGeneratorMA0110.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseRegexSourceGeneratorMA0110 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparerma0002.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparerma0002.md new file mode 100644 index 0000000000..29d1672e00 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparerma0002.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "IEqualityComparer or IComparer is missing" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# IEqualityComparer<string> or IComparer<string> is missing + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparerMA0002** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseStringComparerMA0002.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringComparerMA0002 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparisonma0001.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparisonma0001.md new file mode 100644 index 0000000000..319227beca --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparisonma0001.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "StringComparison is missing" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# StringComparison is missing + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparisonMA0001** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseStringComparisonMA0001.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringComparisonMA0001 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparisonma0074.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparisonma0074.md new file mode 100644 index 0000000000..2a24a756ec --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcomparisonma0074.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid implicit culture-sensitive methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid implicit culture-sensitive methods + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparisonMA0074** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseStringComparisonMA0074.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringComparisonMA0074 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcreateinsteadofformattablestringma0111.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcreateinsteadofformattablestringma0111.md new file mode 100644 index 0000000000..7c6104f91a --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringcreateinsteadofformattablestringma0111.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use string.Create instead of FormattableString" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use string.Create instead of FormattableString + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringCreateInsteadOfFormattableStringMA0111** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseStringCreateInsteadOfFormattableStringMA0111.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringCreateInsteadOfFormattableStringMA0111 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usestringequalsma0006.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringequalsma0006.md new file mode 100644 index 0000000000..4cdece2d97 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usestringequalsma0006.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use String.Equals instead of equality operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use String.Equals instead of equality operator + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringEqualsMA0006** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseStringEqualsMA0006.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringEqualsMA0006 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/usestructlayoutattributema0008.md b/docs/recipes/csharp/recipes/meziantou/analyzer/usestructlayoutattributema0008.md new file mode 100644 index 0000000000..fbf4885565 --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/usestructlayoutattributema0008.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add StructLayoutAttribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add StructLayoutAttribute + +**org.openrewrite.csharp.recipes.meziantou.analyzer.UseStructLayoutAttributeMA0008** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/UseStructLayoutAttributeMA0008.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStructLayoutAttributeMA0008 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/meziantou/analyzer/validateargumentscorrectlyma0050.md b/docs/recipes/csharp/recipes/meziantou/analyzer/validateargumentscorrectlyma0050.md new file mode 100644 index 0000000000..6733cf6cbb --- /dev/null +++ b/docs/recipes/csharp/recipes/meziantou/analyzer/validateargumentscorrectlyma0050.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Validate arguments correctly in iterator methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Validate arguments correctly in iterator methods + +**org.openrewrite.csharp.recipes.meziantou.analyzer.ValidateArgumentsCorrectlyMA0050** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ValidateArgumentsCorrectlyMA0050.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ValidateArgumentsCorrectlyMA0050 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/README.md b/docs/recipes/csharp/recipes/microsoft/README.md new file mode 100644 index 0000000000..9534b2238f --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/README.md @@ -0,0 +1,7 @@ +# Microsoft + +## Categories + +* [Codeanalysis](/recipes/csharp/recipes/microsoft/codeanalysis) + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/README.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/README.md new file mode 100644 index 0000000000..74a3450d25 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/README.md @@ -0,0 +1,7 @@ +# Codeanalysis + +## Categories + +* [Netanalyzers](/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers) + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/README.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/README.md new file mode 100644 index 0000000000..4a4f19a5b4 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/README.md @@ -0,0 +1,104 @@ +# Netanalyzers + +## Recipes + +* [Abstract types should not have public constructors](./abstracttypesshouldnothaveconstructorsca1012.md) +* [All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface](./csharpdynamicinterfacecastableimplementationca2256.md) +* [Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum](./donotcreatetaskcompletionsourcewithwrongargumentsca2247.md) +* [Avoid constant arrays as arguments](./avoidconstarraysca1861.md) +* [Avoid inexact read with 'Stream.Read'](./avoidunreliablestreamreadca2022.md) +* [Avoid redundant length argument](./avoidlengthcalculationwhenslicingtoendca1514.md) +* [Avoid unsealed attributes](./avoidunsealedattributesca1813.md) +* [Avoid unused private fields](./avoidunusedprivatefieldsca1823.md) +* [Avoid using 'Enumerable.Any()' extension method](./csharppreferlengthcountisemptyoveranyca1860.md) +* [Avoid zero-length array allocations](./avoidzerolengtharrayallocationsca1825.md) +* [Consider calling ConfigureAwait on the awaited task](./donotdirectlyawaitataskca2007.md) +* [Consider making public types internal](./csharpmaketypesinternalca1515.md) +* [Consider using 'StringBuilder.Append(char)' when applicable](./preferconstcharoverconstunitstringca1834.md) +* [Consider using 'string.Contains' instead of 'string.IndexOf'](./preferstringcontainsoverindexofca2249.md) +* [Define accessors for attribute arguments](./defineaccessorsforattributeargumentsca1019.md) +* [Dispose methods should call base class dispose](./csharpdisposemethodsshouldcallbaseclassdisposeca2215.md) +* [Do not call ToImmutableCollection on an ImmutableCollection value](./donotcalltoimmutablecollectiononanimmutablecollectionvalueca2009.md) +* [Do not compare Span to 'null' or 'default'](./csharpdonotcomparespantonullca2265.md) +* [Do not duplicate indexed element initializations](./csharpavoidduplicateelementinitializationca2244.md) +* [Do not initialize unnecessarily](./csharpdonotinitializeunnecessarilyca1805.md) +* [Do not mark enums with FlagsAttribute](./enumwithflagsattributeca2217.md) +* [Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'](./csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca2264.md) +* [Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'](./csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca1871.md) +* [Do not use 'WaitAll' with a single task](./donotusewhenallorwaitallwithsingleargumentca1843.md) +* [Do not use 'WhenAll' with a single task](./donotusewhenallorwaitallwithsingleargumentca1842.md) +* [Do not use Count() or LongCount() when Any() can be used](./csharpdonotusecountwhenanycanbeusedca1827.md) +* [Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used](./csharpdonotusecountwhenanycanbeusedca1828.md) +* [Do not use Enumerable methods on indexable collections](./csharpdonotuseenumerablemethodsonindexablecollectionsinsteadusethecollectiondirectlyca1826.md) +* [Enum Storage should be Int32](./csharpenumstorageshouldbeint32ca1028.md) +* [Enums should have zero value](./csharpenumsshouldhavezerovalueca1008.md) +* [Exceptions should be public](./exceptionsshouldbepublicca1064.md) +* [Forward the 'CancellationToken' parameter to methods](./csharpforwardcancellationtokentoinvocationsca2016.md) +* [Identifiers should not contain underscores](./csharpidentifiersshouldnotcontainunderscoresca1707.md) +* [Implement IEquatable when overriding Object.Equals](./equatableca1066.md) +* [Implement standard exception constructors](./implementstandardexceptionconstructorsca1032.md) +* [Instantiate argument exceptions correctly](./instantiateargumentexceptionscorrectlyca2208.md) +* [Interface methods should be callable by child types](./interfacemethodsshouldbecallablebychildtypesca1033.md) +* [Mark ISerializable types with serializable](./marktypeswithserializableca2237.md) +* [Mark all non-serializable fields](./csharpmarkallnonserializablefieldsca2235.md) +* [Mark attributes with AttributeUsageAttribute](./markattributeswithattributeusageca1018.md) +* [Mark enums with FlagsAttribute](./enumwithflagsattributeca1027.md) +* [Mark members as static](./csharpmarkmembersasstaticca1822.md) +* [Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static'](./csharpdynamicinterfacecastableimplementationca2257.md) +* [Operator overloads have named alternates](./operatoroverloadshavenamedalternatesca2225.md) +* [Operators should have symmetrical overloads](./operatorsshouldhavesymmetricaloverloadsca2226.md) +* [Overload operator equals on overriding value type Equals](./overloadoperatorequalsonoverridingvaluetypeequalsca2231.md) +* [Override Object.Equals(object) when implementing IEquatable](./equatableca1067.md) +* [Override equals and operator equals on value types](./csharpoverrideequalsandoperatorequalsonvaluetypesca1815.md) +* [Override methods on comparable types](./overridemethodsoncomparabletypesca1036.md) +* [Parameter names should match base declaration](./parameternamesshouldmatchbasedeclarationca1725.md) +* [Prefer 'AsSpan' over 'Substring'](./csharppreferasspanoversubstringca1846.md) +* [Prefer 'Clear' over 'Fill'](./csharpusespanclearinsteadoffillca1855.md) +* [Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'](./preferconverttohexstringoverbitconverterca1872.md) +* [Prefer Dictionary.Contains methods](./csharppreferdictionarycontainsmethodsca1841.md) +* [Prefer IsEmpty over Count](./csharppreferisemptyovercountca1836.md) +* [Prefer generic overload when type is known](./csharpprefergenericoverloadsca2263.md) +* [Prefer static 'HashData' method over 'ComputeHash'](./csharppreferhashdataovercomputehashca1850.md) +* [Prefer strongly-typed Append and Insert method overloads on StringBuilder](./prefertypedstringbuilderappendoverloadsca1830.md) +* [Prefer the 'IDictionary.TryAdd(TKey, TValue)' method](./csharppreferdictionarytrymethodsovercontainskeyguardca1864.md) +* [Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method](./csharppreferdictionarytrymethodsovercontainskeyguardca1854.md) +* [Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'](./csharppreferstreamasyncmemoryoverloadsca1835.md) +* [Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle'](./providepublicparameterlesssafehandleconstructorca1419.md) +* [Remove empty Finalizers](./removeemptyfinalizersca1821.md) +* [Rethrow to preserve stack details](./rethrowtopreservestackdetailsca2200.md) +* [Seal internal types](./sealinternaltypesca1852.md) +* [Seal methods that satisfy private interfaces](./sealmethodsthatsatisfyprivateinterfacesca2119.md) +* [Specify a culture or use an invariant version](./csharpspecifyculturefortolowerandtoupperca1311.md) +* [Specify marshaling for P/Invoke string arguments](./csharpspecifymarshalingforpinvokestringargumentsca2101.md) +* [Static holder types should be Static or NotInheritable](./csharpstaticholdertypesca1052.md) +* [Test for NaN correctly](./csharptestfornancorrectlyca2242.md) +* [Test for empty strings using string length](./csharptestforemptystringsusingstringlengthca1820.md) +* [This method uses runtime marshalling even when the 'DisableRuntimeMarshallingAttribute' is applied](./csharpdisableruntimemarshallingca1421.md) +* [Types that own disposable fields should be disposable](./typesthatowndisposablefieldsshouldbedisposableca1001.md) +* [URI-like parameters should not be strings](./uriparametersshouldnotbestringsca1054.md) +* [Unnecessary call to 'Contains(item)'](./csharpdonotguardcallca1868.md) +* [Unnecessary call to 'Dictionary.ContainsKey(key)'](./csharpdonotguardcallca1853.md) +* [Use 'Environment.CurrentManagedThreadId'](./useenvironmentmembersca1840.md) +* [Use 'Environment.ProcessId'](./useenvironmentmembersca1837.md) +* [Use 'Environment.ProcessPath'](./useenvironmentmembersca1839.md) +* [Use 'StartsWith' instead of 'IndexOf'](./csharpusestartswithinsteadofindexofcomparisonwithzerocodefixca1858.md) +* [Use 'ThrowIfCancellationRequested'](./usecancellationtokenthrowifcancellationrequestedca2250.md) +* [Use 'string.Equals'](./usestringequalsoverstringcompareca2251.md) +* [Use ArgumentException throw helper](./useexceptionthrowhelpersca1511.md) +* [Use ArgumentNullException throw helper](./useexceptionthrowhelpersca1510.md) +* [Use ArgumentOutOfRangeException throw helper](./useexceptionthrowhelpersca1512.md) +* [Use AsSpan or AsMemory instead of Range-based indexers when appropriate](./csharpuseasspaninsteadofrangeindexerca1831.md) +* [Use AsSpan or AsMemory instead of Range-based indexers when appropriate](./csharpuseasspaninsteadofrangeindexerca1832.md) +* [Use AsSpan or AsMemory instead of Range-based indexers when appropriate](./csharpuseasspaninsteadofrangeindexerca1833.md) +* [Use Length/Count property instead of Count() when available](./csharpusepropertyinsteadofcountmethodwhenavailableca1829.md) +* [Use ObjectDisposedException throw helper](./useexceptionthrowhelpersca1513.md) +* [Use a cached 'SearchValues' instance](./csharpusesearchvaluesca1870.md) +* [Use char literal for a single character lookup](./csharpusestringcontainscharoverloadwithsinglecharactersca1847.md) +* [Use char overload](./csharpusestringmethodcharoverloadwithsinglecharactersca1865.md) +* [Use literals where appropriate](./csharpuseliteralswhereappropriateca1802.md) +* [Use nameof to express symbol names](./usenameofinplaceofstringca1507.md) +* [Use ordinal string comparison](./csharpuseordinalstringcomparisonca1309.md) +* [Use span-based 'string.Concat'](./csharpusespanbasedstringconcatca1845.md) +* [Use the 'StringComparison' method overloads to perform case-insensitive string comparisons](./csharprecommendcaseinsensitivestringcomparisonca1862.md) + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/abstracttypesshouldnothaveconstructorsca1012.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/abstracttypesshouldnothaveconstructorsca1012.md new file mode 100644 index 0000000000..4b11bab220 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/abstracttypesshouldnothaveconstructorsca1012.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Abstract types should not have public constructors" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Abstract types should not have public constructors + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AbstractTypesShouldNotHaveConstructorsCA1012** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AbstractTypesShouldNotHaveConstructorsCA1012.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AbstractTypesShouldNotHaveConstructorsCA1012 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidconstarraysca1861.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidconstarraysca1861.md new file mode 100644 index 0000000000..819242d613 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidconstarraysca1861.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid constant arrays as arguments" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid constant arrays as arguments + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidConstArraysCA1861** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AvoidConstArraysCA1861.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidConstArraysCA1861 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidlengthcalculationwhenslicingtoendca1514.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidlengthcalculationwhenslicingtoendca1514.md new file mode 100644 index 0000000000..7faacfd3b3 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidlengthcalculationwhenslicingtoendca1514.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid redundant length argument" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid redundant length argument + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidLengthCalculationWhenSlicingToEndCA1514** + +_An explicit length calculation can be error-prone and can be avoided when slicing to end of the buffer._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AvoidLengthCalculationWhenSlicingToEndCA1514.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidLengthCalculationWhenSlicingToEndCA1514 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunreliablestreamreadca2022.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunreliablestreamreadca2022.md new file mode 100644 index 0000000000..385d27b47c --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunreliablestreamreadca2022.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid inexact read with 'Stream.Read'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid inexact read with 'Stream.Read' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnreliableStreamReadCA2022** + +_A call to 'Stream.Read' may return fewer bytes than requested, resulting in unreliable code if the return value is not checked._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AvoidUnreliableStreamReadCA2022.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidUnreliableStreamReadCA2022 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunsealedattributesca1813.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunsealedattributesca1813.md new file mode 100644 index 0000000000..0976eced10 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunsealedattributesca1813.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid unsealed attributes" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid unsealed attributes + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnsealedAttributesCA1813** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AvoidUnsealedAttributesCA1813.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidUnsealedAttributesCA1813 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunusedprivatefieldsca1823.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunusedprivatefieldsca1823.md new file mode 100644 index 0000000000..48a8a54e1a --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidunusedprivatefieldsca1823.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid unused private fields" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid unused private fields + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnusedPrivateFieldsCA1823** + +_Private fields were detected that do not appear to be accessed in the assembly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AvoidUnusedPrivateFieldsCA1823.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidUnusedPrivateFieldsCA1823 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidzerolengtharrayallocationsca1825.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidzerolengtharrayallocationsca1825.md new file mode 100644 index 0000000000..54cc15726e --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/avoidzerolengtharrayallocationsca1825.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid zero-length array allocations" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid zero-length array allocations + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidZeroLengthArrayAllocationsCA1825** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/AvoidZeroLengthArrayAllocationsCA1825.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidZeroLengthArrayAllocationsCA1825 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpavoidduplicateelementinitializationca2244.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpavoidduplicateelementinitializationca2244.md new file mode 100644 index 0000000000..ffcb7e5aca --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpavoidduplicateelementinitializationca2244.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not duplicate indexed element initializations" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not duplicate indexed element initializations + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpAvoidDuplicateElementInitializationCA2244** + +_Indexed elements in objects initializers must initialize unique elements. A duplicate index might overwrite a previous element initialization._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpAvoidDuplicateElementInitializationCA2244.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpAvoidDuplicateElementInitializationCA2244 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdisableruntimemarshallingca1421.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdisableruntimemarshallingca1421.md new file mode 100644 index 0000000000..c82c024739 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdisableruntimemarshallingca1421.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "This method uses runtime marshalling even when the 'DisableRuntimeMarshallingAttribute' is applied" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# This method uses runtime marshalling even when the 'DisableRuntimeMarshallingAttribute' is applied + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDisableRuntimeMarshallingCA1421** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDisableRuntimeMarshallingCA1421.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDisableRuntimeMarshallingCA1421 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdisposemethodsshouldcallbaseclassdisposeca2215.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdisposemethodsshouldcallbaseclassdisposeca2215.md new file mode 100644 index 0000000000..b815e418b7 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdisposemethodsshouldcallbaseclassdisposeca2215.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Dispose methods should call base class dispose" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Dispose methods should call base class dispose + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDisposeMethodsShouldCallBaseClassDisposeCA2215** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDisposeMethodsShouldCallBaseClassDisposeCA2215.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDisposeMethodsShouldCallBaseClassDisposeCA2215 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotcomparespantonullca2265.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotcomparespantonullca2265.md new file mode 100644 index 0000000000..afc59b7d51 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotcomparespantonullca2265.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Do not compare Span to 'null' or 'default'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not compare Span<T> to 'null' or 'default' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotCompareSpanToNullCA2265** + +``` +Comparing a span to 'null' or 'default' might not do what you intended. 'default' and the 'null' literal are implicitly converted to 'Span.Empty'. Remove the redundant comparison or make the code more explicit by using 'IsEmpty'. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotCompareSpanToNullCA2265.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotCompareSpanToNullCA2265 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotguardcallca1853.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotguardcallca1853.md new file mode 100644 index 0000000000..8932eccb1a --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotguardcallca1853.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Unnecessary call to 'Dictionary.ContainsKey(key)'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary call to 'Dictionary.ContainsKey(key)' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotGuardCallCA1853** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotGuardCallCA1853.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotGuardCallCA1853 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotguardcallca1868.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotguardcallca1868.md new file mode 100644 index 0000000000..4e8e987bd2 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotguardcallca1868.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Unnecessary call to 'Contains(item)'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary call to 'Contains(item)' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotGuardCallCA1868** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotGuardCallCA1868.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotGuardCallCA1868 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotinitializeunnecessarilyca1805.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotinitializeunnecessarilyca1805.md new file mode 100644 index 0000000000..e714d3d816 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotinitializeunnecessarilyca1805.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not initialize unnecessarily" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not initialize unnecessarily + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotInitializeUnnecessarilyCA1805** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotInitializeUnnecessarilyCA1805.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotInitializeUnnecessarilyCA1805 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca1871.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca1871.md new file mode 100644 index 0000000000..7d4dd7d8eb --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca1871.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA1871** + +_'ArgumentNullException.ThrowIfNull' accepts an 'object', so passing a nullable struct may cause the value to be boxed._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA1871.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA1871 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca2264.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca2264.md new file mode 100644 index 0000000000..9b8c52610c --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotpassnonnullablevaluetoargumentnullexceptionthrowifnullca2264.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA2264** + +_'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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA2264.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA2264 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotusecountwhenanycanbeusedca1827.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotusecountwhenanycanbeusedca1827.md new file mode 100644 index 0000000000..1bd3f08fb6 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotusecountwhenanycanbeusedca1827.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use Count() or LongCount() when Any() can be used" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use Count() or LongCount() when Any() can be used + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseCountWhenAnyCanBeUsedCA1827** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotUseCountWhenAnyCanBeUsedCA1827.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotUseCountWhenAnyCanBeUsedCA1827 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotusecountwhenanycanbeusedca1828.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotusecountwhenanycanbeusedca1828.md new file mode 100644 index 0000000000..07e2007b40 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotusecountwhenanycanbeusedca1828.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseCountWhenAnyCanBeUsedCA1828** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotUseCountWhenAnyCanBeUsedCA1828.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotUseCountWhenAnyCanBeUsedCA1828 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotuseenumerablemethodsonindexablecollectionsinsteadusethecollectiondirectlyca1826.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotuseenumerablemethodsonindexablecollectionsinsteadusethecollectiondirectlyca1826.md new file mode 100644 index 0000000000..c6b2b14799 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdonotuseenumerablemethodsonindexablecollectionsinsteadusethecollectiondirectlyca1826.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use Enumerable methods on indexable collections" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use Enumerable methods on indexable collections + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyCA1826** + +_This collection is directly indexable. Going through LINQ here causes unnecessary allocations and CPU work._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyCA1826.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyCA1826 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdynamicinterfacecastableimplementationca2256.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdynamicinterfacecastableimplementationca2256.md new file mode 100644 index 0000000000..e49d56ee73 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdynamicinterfacecastableimplementationca2256.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDynamicInterfaceCastableImplementationCA2256** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDynamicInterfaceCastableImplementationCA2256.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDynamicInterfaceCastableImplementationCA2256 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdynamicinterfacecastableimplementationca2257.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdynamicinterfacecastableimplementationca2257.md new file mode 100644 index 0000000000..b5f1130445 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpdynamicinterfacecastableimplementationca2257.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDynamicInterfaceCastableImplementationCA2257** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpDynamicInterfaceCastableImplementationCA2257.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpDynamicInterfaceCastableImplementationCA2257 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpenumsshouldhavezerovalueca1008.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpenumsshouldhavezerovalueca1008.md new file mode 100644 index 0000000000..f0c8c2756b --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpenumsshouldhavezerovalueca1008.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Enums should have zero value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Enums should have zero value + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpEnumsShouldHaveZeroValueCA1008** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpEnumsShouldHaveZeroValueCA1008.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpEnumsShouldHaveZeroValueCA1008 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpenumstorageshouldbeint32ca1028.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpenumstorageshouldbeint32ca1028.md new file mode 100644 index 0000000000..3cde3b7548 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpenumstorageshouldbeint32ca1028.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Enum Storage should be Int32" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Enum Storage should be Int32 + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpEnumStorageShouldBeInt32CA1028** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpEnumStorageShouldBeInt32CA1028.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpEnumStorageShouldBeInt32CA1028 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpforwardcancellationtokentoinvocationsca2016.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpforwardcancellationtokentoinvocationsca2016.md new file mode 100644 index 0000000000..bff98f3230 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpforwardcancellationtokentoinvocationsca2016.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Forward the 'CancellationToken' parameter to methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Forward the 'CancellationToken' parameter to methods + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpForwardCancellationTokenToInvocationsCA2016** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpForwardCancellationTokenToInvocationsCA2016.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpForwardCancellationTokenToInvocationsCA2016 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpidentifiersshouldnotcontainunderscoresca1707.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpidentifiersshouldnotcontainunderscoresca1707.md new file mode 100644 index 0000000000..9dbb962f3c --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpidentifiersshouldnotcontainunderscoresca1707.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Identifiers should not contain underscores" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Identifiers should not contain underscores + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpIdentifiersShouldNotContainUnderscoresCA1707** + +_By convention, identifier names do not contain the underscore (_) character. This rule checks namespaces, types, members, and parameters._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpIdentifiersShouldNotContainUnderscoresCA1707.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpIdentifiersShouldNotContainUnderscoresCA1707 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmaketypesinternalca1515.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmaketypesinternalca1515.md new file mode 100644 index 0000000000..33adcebeb7 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmaketypesinternalca1515.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Consider making public types internal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Consider making public types internal + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMakeTypesInternalCA1515** + +_Unlike a class library, an application's API isn't typically referenced publicly, so types can be marked internal._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpMakeTypesInternalCA1515.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpMakeTypesInternalCA1515 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmarkallnonserializablefieldsca2235.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmarkallnonserializablefieldsca2235.md new file mode 100644 index 0000000000..256b3bb653 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmarkallnonserializablefieldsca2235.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Mark all non-serializable fields" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark all non-serializable fields + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMarkAllNonSerializableFieldsCA2235** + +_An instance field of a type that is not serializable is declared in a type that is serializable._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpMarkAllNonSerializableFieldsCA2235.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpMarkAllNonSerializableFieldsCA2235 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmarkmembersasstaticca1822.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmarkmembersasstaticca1822.md new file mode 100644 index 0000000000..4a01149a04 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpmarkmembersasstaticca1822.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Mark members as static" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark members as static + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMarkMembersAsStaticCA1822** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpMarkMembersAsStaticCA1822.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpMarkMembersAsStaticCA1822 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpoverrideequalsandoperatorequalsonvaluetypesca1815.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpoverrideequalsandoperatorequalsonvaluetypesca1815.md new file mode 100644 index 0000000000..52998e11a1 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpoverrideequalsandoperatorequalsonvaluetypesca1815.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Override equals and operator equals on value types" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Override equals and operator equals on value types + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpOverrideEqualsAndOperatorEqualsOnValueTypesCA1815** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpOverrideEqualsAndOperatorEqualsOnValueTypesCA1815.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpOverrideEqualsAndOperatorEqualsOnValueTypesCA1815 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferasspanoversubstringca1846.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferasspanoversubstringca1846.md new file mode 100644 index 0000000000..e43662a1f9 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferasspanoversubstringca1846.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer 'AsSpan' over 'Substring'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer 'AsSpan' over 'Substring' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferAsSpanOverSubstringCA1846** + +_'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferAsSpanOverSubstringCA1846.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferAsSpanOverSubstringCA1846 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarycontainsmethodsca1841.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarycontainsmethodsca1841.md new file mode 100644 index 0000000000..457d7cd09d --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarycontainsmethodsca1841.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer Dictionary.Contains methods" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer Dictionary.Contains methods + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryContainsMethodsCA1841** + +_'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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferDictionaryContainsMethodsCA1841.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferDictionaryContainsMethodsCA1841 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarytrymethodsovercontainskeyguardca1854.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarytrymethodsovercontainskeyguardca1854.md new file mode 100644 index 0000000000..bb0ce9ff97 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarytrymethodsovercontainskeyguardca1854.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1854** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1854.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1854 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarytrymethodsovercontainskeyguardca1864.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarytrymethodsovercontainskeyguardca1864.md new file mode 100644 index 0000000000..0bb3f4cd76 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferdictionarytrymethodsovercontainskeyguardca1864.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer the 'IDictionary.TryAdd(TKey, TValue)' method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer the 'IDictionary.TryAdd(TKey, TValue)' method + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1864** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1864.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1864 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpprefergenericoverloadsca2263.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpprefergenericoverloadsca2263.md new file mode 100644 index 0000000000..cdd2df44ca --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpprefergenericoverloadsca2263.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer generic overload when type is known" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer generic overload when type is known + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferGenericOverloadsCA2263** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferGenericOverloadsCA2263.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferGenericOverloadsCA2263 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferhashdataovercomputehashca1850.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferhashdataovercomputehashca1850.md new file mode 100644 index 0000000000..41643434b0 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferhashdataovercomputehashca1850.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer static 'HashData' method over 'ComputeHash'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer static 'HashData' method over 'ComputeHash' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferHashDataOverComputeHashCA1850** + +_It is more efficient to use the static 'HashData' method over creating and managing a HashAlgorithm instance to call 'ComputeHash'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferHashDataOverComputeHashCA1850.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferHashDataOverComputeHashCA1850 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferisemptyovercountca1836.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferisemptyovercountca1836.md new file mode 100644 index 0000000000..c51a4c8a62 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferisemptyovercountca1836.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer IsEmpty over Count" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer IsEmpty over Count + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferIsEmptyOverCountCA1836** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferIsEmptyOverCountCA1836.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferIsEmptyOverCountCA1836 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferlengthcountisemptyoveranyca1860.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferlengthcountisemptyoveranyca1860.md new file mode 100644 index 0000000000..f561f1f1b1 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferlengthcountisemptyoveranyca1860.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Avoid using 'Enumerable.Any()' extension method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid using 'Enumerable.Any()' extension method + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferLengthCountIsEmptyOverAnyCA1860** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferLengthCountIsEmptyOverAnyCA1860.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferLengthCountIsEmptyOverAnyCA1860 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferstreamasyncmemoryoverloadsca1835.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferstreamasyncmemoryoverloadsca1835.md new file mode 100644 index 0000000000..8453ab12cb --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharppreferstreamasyncmemoryoverloadsca1835.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferStreamAsyncMemoryOverloadsCA1835** + +``` +'Stream' has a 'ReadAsync' overload that takes a 'Memory' as the first argument, and a 'WriteAsync' overload that takes a 'ReadOnlyMemory' as the first argument. Prefer calling the memory based overloads, which are more efficient. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpPreferStreamAsyncMemoryOverloadsCA1835.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpPreferStreamAsyncMemoryOverloadsCA1835 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharprecommendcaseinsensitivestringcomparisonca1862.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharprecommendcaseinsensitivestringcomparisonca1862.md new file mode 100644 index 0000000000..ab456e7496 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharprecommendcaseinsensitivestringcomparisonca1862.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use the 'StringComparison' method overloads to perform case-insensitive string comparisons" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use the 'StringComparison' method overloads to perform case-insensitive string comparisons + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpRecommendCaseInsensitiveStringComparisonCA1862** + +_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'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpRecommendCaseInsensitiveStringComparisonCA1862.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpRecommendCaseInsensitiveStringComparisonCA1862 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpspecifyculturefortolowerandtoupperca1311.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpspecifyculturefortolowerandtoupperca1311.md new file mode 100644 index 0000000000..87f1b21423 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpspecifyculturefortolowerandtoupperca1311.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Specify a culture or use an invariant version" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Specify a culture or use an invariant version + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpSpecifyCultureForToLowerAndToUpperCA1311** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpSpecifyCultureForToLowerAndToUpperCA1311.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpSpecifyCultureForToLowerAndToUpperCA1311 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpspecifymarshalingforpinvokestringargumentsca2101.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpspecifymarshalingforpinvokestringargumentsca2101.md new file mode 100644 index 0000000000..013d666750 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpspecifymarshalingforpinvokestringargumentsca2101.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Specify marshaling for P/Invoke string arguments" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Specify marshaling for P/Invoke string arguments + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpSpecifyMarshalingForPInvokeStringArgumentsCA2101** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpSpecifyMarshalingForPInvokeStringArgumentsCA2101.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpSpecifyMarshalingForPInvokeStringArgumentsCA2101 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpstaticholdertypesca1052.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpstaticholdertypesca1052.md new file mode 100644 index 0000000000..2323df8fbe --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpstaticholdertypesca1052.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Static holder types should be Static or NotInheritable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Static holder types should be Static or NotInheritable + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpStaticHolderTypesCA1052** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpStaticHolderTypesCA1052.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpStaticHolderTypesCA1052 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharptestforemptystringsusingstringlengthca1820.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharptestforemptystringsusingstringlengthca1820.md new file mode 100644 index 0000000000..f685435ae8 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharptestforemptystringsusingstringlengthca1820.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Test for empty strings using string length" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Test for empty strings using string length + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpTestForEmptyStringsUsingStringLengthCA1820** + +_Comparing strings by using the String.Length property or the String.IsNullOrEmpty method is significantly faster than using Equals._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpTestForEmptyStringsUsingStringLengthCA1820.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpTestForEmptyStringsUsingStringLengthCA1820 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharptestfornancorrectlyca2242.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharptestfornancorrectlyca2242.md new file mode 100644 index 0000000000..4dced034fc --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharptestfornancorrectlyca2242.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Test for NaN correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Test for NaN correctly + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpTestForNaNCorrectlyCA2242** + +_This expression tests a value against Single.Nan or Double.Nan. Use Single.IsNan(Single) or Double.IsNan(Double) to test the value._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpTestForNaNCorrectlyCA2242.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpTestForNaNCorrectlyCA2242 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1831.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1831.md new file mode 100644 index 0000000000..5a09baeace --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1831.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use AsSpan or AsMemory instead of Range-based indexers when appropriate" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use AsSpan or AsMemory instead of Range-based indexers when appropriate + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1831** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseAsSpanInsteadOfRangeIndexerCA1831.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseAsSpanInsteadOfRangeIndexerCA1831 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1832.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1832.md new file mode 100644 index 0000000000..e7d50db2bf --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1832.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use AsSpan or AsMemory instead of Range-based indexers when appropriate" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use AsSpan or AsMemory instead of Range-based indexers when appropriate + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1832** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseAsSpanInsteadOfRangeIndexerCA1832.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseAsSpanInsteadOfRangeIndexerCA1832 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1833.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1833.md new file mode 100644 index 0000000000..52283f8112 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseasspaninsteadofrangeindexerca1833.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use AsSpan or AsMemory instead of Range-based indexers when appropriate" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use AsSpan or AsMemory instead of Range-based indexers when appropriate + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1833** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseAsSpanInsteadOfRangeIndexerCA1833.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseAsSpanInsteadOfRangeIndexerCA1833 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseliteralswhereappropriateca1802.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseliteralswhereappropriateca1802.md new file mode 100644 index 0000000000..94f8c7506d --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseliteralswhereappropriateca1802.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use literals where appropriate" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use literals where appropriate + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseLiteralsWhereAppropriateCA1802** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseLiteralsWhereAppropriateCA1802.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseLiteralsWhereAppropriateCA1802 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseordinalstringcomparisonca1309.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseordinalstringcomparisonca1309.md new file mode 100644 index 0000000000..44bcfd1f53 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpuseordinalstringcomparisonca1309.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use ordinal string comparison" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use ordinal string comparison + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseOrdinalStringComparisonCA1309** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseOrdinalStringComparisonCA1309.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseOrdinalStringComparisonCA1309 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusepropertyinsteadofcountmethodwhenavailableca1829.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusepropertyinsteadofcountmethodwhenavailableca1829.md new file mode 100644 index 0000000000..49bbbae77f --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusepropertyinsteadofcountmethodwhenavailableca1829.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use Length/Count property instead of Count() when available" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use Length/Count property instead of Count() when available + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUsePropertyInsteadOfCountMethodWhenAvailableCA1829** + +_Enumerable.Count() potentially enumerates the sequence while a Length/Count property is a direct access._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUsePropertyInsteadOfCountMethodWhenAvailableCA1829.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUsePropertyInsteadOfCountMethodWhenAvailableCA1829 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusesearchvaluesca1870.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusesearchvaluesca1870.md new file mode 100644 index 0000000000..ca62c8a6d6 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusesearchvaluesca1870.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use a cached 'SearchValues' instance" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use a cached 'SearchValues' instance + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSearchValuesCA1870** + +_Using a cached 'SearchValues' instance is more efficient than passing values to 'IndexOfAny'/'ContainsAny' directly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseSearchValuesCA1870.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseSearchValuesCA1870 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusespanbasedstringconcatca1845.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusespanbasedstringconcatca1845.md new file mode 100644 index 0000000000..0f8a198b5e --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusespanbasedstringconcatca1845.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use span-based 'string.Concat'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use span-based 'string.Concat' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSpanBasedStringConcatCA1845** + +_It is more efficient to use 'AsSpan' and 'string.Concat', instead of 'Substring' and a concatenation operator._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseSpanBasedStringConcatCA1845.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseSpanBasedStringConcatCA1845 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusespanclearinsteadoffillca1855.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusespanclearinsteadoffillca1855.md new file mode 100644 index 0000000000..d297fdad39 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusespanclearinsteadoffillca1855.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer 'Clear' over 'Fill'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer 'Clear' over 'Fill' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSpanClearInsteadOfFillCA1855** + +_It is more efficient to use 'Clear', instead of 'Fill' with default value._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseSpanClearInsteadOfFillCA1855.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseSpanClearInsteadOfFillCA1855 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestartswithinsteadofindexofcomparisonwithzerocodefixca1858.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestartswithinsteadofindexofcomparisonwithzerocodefixca1858.md new file mode 100644 index 0000000000..abee283e16 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestartswithinsteadofindexofcomparisonwithzerocodefixca1858.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use 'StartsWith' instead of 'IndexOf'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'StartsWith' instead of 'IndexOf' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStartsWithInsteadOfIndexOfComparisonWithZeroCodeFixCA1858** + +_It is both clearer and faster to use 'StartsWith' instead of comparing the result of 'IndexOf' to zero._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseStartsWithInsteadOfIndexOfComparisonWithZeroCodeFixCA1858.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseStartsWithInsteadOfIndexOfComparisonWithZeroCodeFixCA1858 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestringcontainscharoverloadwithsinglecharactersca1847.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestringcontainscharoverloadwithsinglecharactersca1847.md new file mode 100644 index 0000000000..72f836c5cc --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestringcontainscharoverloadwithsinglecharactersca1847.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use char literal for a single character lookup" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use char literal for a single character lookup + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStringContainsCharOverloadWithSingleCharactersCA1847** + +_'string.Contains(char)' is available as a better performing overload for single char lookup._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseStringContainsCharOverloadWithSingleCharactersCA1847.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseStringContainsCharOverloadWithSingleCharactersCA1847 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestringmethodcharoverloadwithsinglecharactersca1865.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestringmethodcharoverloadwithsinglecharactersca1865.md new file mode 100644 index 0000000000..8d7aab9ee5 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/csharpusestringmethodcharoverloadwithsinglecharactersca1865.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use char overload" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use char overload + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStringMethodCharOverloadWithSingleCharactersCA1865** + +_The char overload is a better performing overload than a string with a single char._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/CSharpUseStringMethodCharOverloadWithSingleCharactersCA1865.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CSharpUseStringMethodCharOverloadWithSingleCharactersCA1865 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/defineaccessorsforattributeargumentsca1019.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/defineaccessorsforattributeargumentsca1019.md new file mode 100644 index 0000000000..109cf458fd --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/defineaccessorsforattributeargumentsca1019.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Define accessors for attribute arguments" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Define accessors for attribute arguments + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DefineAccessorsForAttributeArgumentsCA1019** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/DefineAccessorsForAttributeArgumentsCA1019.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DefineAccessorsForAttributeArgumentsCA1019 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotcalltoimmutablecollectiononanimmutablecollectionvalueca2009.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotcalltoimmutablecollectiononanimmutablecollectionvalueca2009.md new file mode 100644 index 0000000000..71aef3cfb5 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotcalltoimmutablecollectiononanimmutablecollectionvalueca2009.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Do not call ToImmutableCollection on an ImmutableCollection value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not call ToImmutableCollection on an ImmutableCollection value + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueCA2009** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/DoNotCallToImmutableCollectionOnAnImmutableCollectionValueCA2009.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotCallToImmutableCollectionOnAnImmutableCollectionValueCA2009 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotcreatetaskcompletionsourcewithwrongargumentsca2247.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotcreatetaskcompletionsourcewithwrongargumentsca2247.md new file mode 100644 index 0000000000..7ab38346ce --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotcreatetaskcompletionsourcewithwrongargumentsca2247.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotCreateTaskCompletionSourceWithWrongArgumentsCA2247** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/DoNotCreateTaskCompletionSourceWithWrongArgumentsCA2247.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotCreateTaskCompletionSourceWithWrongArgumentsCA2247 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotdirectlyawaitataskca2007.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotdirectlyawaitataskca2007.md new file mode 100644 index 0000000000..16883f7dd4 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotdirectlyawaitataskca2007.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Consider calling ConfigureAwait on the awaited task" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Consider calling ConfigureAwait on the awaited task + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotDirectlyAwaitATaskCA2007** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/DoNotDirectlyAwaitATaskCA2007.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotDirectlyAwaitATaskCA2007 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotusewhenallorwaitallwithsingleargumentca1842.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotusewhenallorwaitallwithsingleargumentca1842.md new file mode 100644 index 0000000000..4810ac466c --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotusewhenallorwaitallwithsingleargumentca1842.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use 'WhenAll' with a single task" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use 'WhenAll' with a single task + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1842** + +_Using 'WhenAll' with a single task may result in performance loss, await or return the task instead._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1842.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1842 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotusewhenallorwaitallwithsingleargumentca1843.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotusewhenallorwaitallwithsingleargumentca1843.md new file mode 100644 index 0000000000..e43bd1e76c --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/donotusewhenallorwaitallwithsingleargumentca1843.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use 'WaitAll' with a single task" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use 'WaitAll' with a single task + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1843** + +_Using 'WaitAll' with a single task may result in performance loss, await or return the task instead._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1843.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1843 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/enumwithflagsattributeca1027.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/enumwithflagsattributeca1027.md new file mode 100644 index 0000000000..2b95582660 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/enumwithflagsattributeca1027.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Mark enums with FlagsAttribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark enums with FlagsAttribute + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EnumWithFlagsAttributeCA1027** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/EnumWithFlagsAttributeCA1027.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumWithFlagsAttributeCA1027 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/enumwithflagsattributeca2217.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/enumwithflagsattributeca2217.md new file mode 100644 index 0000000000..f13f98eb73 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/enumwithflagsattributeca2217.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not mark enums with FlagsAttribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not mark enums with FlagsAttribute + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EnumWithFlagsAttributeCA2217** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/EnumWithFlagsAttributeCA2217.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumWithFlagsAttributeCA2217 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/equatableca1066.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/equatableca1066.md new file mode 100644 index 0000000000..3b7a7e4578 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/equatableca1066.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Implement IEquatable when overriding Object.Equals" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Implement IEquatable when overriding Object.Equals + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EquatableCA1066** + +``` +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, 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.Equals(T) instead of Object.Equals(object), and no cast is necessary, improving performance. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/EquatableCA1066.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EquatableCA1066 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/equatableca1067.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/equatableca1067.md new file mode 100644 index 0000000000..e76d8039fb --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/equatableca1067.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Override Object.Equals(object) when implementing IEquatable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Override Object.Equals(object) when implementing IEquatable<T> + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EquatableCA1067** + +``` +When a type T implements the interface IEquatable, 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". +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/EquatableCA1067.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EquatableCA1067 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/exceptionsshouldbepublicca1064.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/exceptionsshouldbepublicca1064.md new file mode 100644 index 0000000000..a388c48989 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/exceptionsshouldbepublicca1064.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Exceptions should be public" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Exceptions should be public + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ExceptionsShouldBePublicCA1064** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/ExceptionsShouldBePublicCA1064.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ExceptionsShouldBePublicCA1064 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/implementstandardexceptionconstructorsca1032.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/implementstandardexceptionconstructorsca1032.md new file mode 100644 index 0000000000..32b326d0ed --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/implementstandardexceptionconstructorsca1032.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Implement standard exception constructors" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Implement standard exception constructors + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ImplementStandardExceptionConstructorsCA1032** + +_Failure to provide the full set of constructors can make it difficult to correctly handle exceptions._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/ImplementStandardExceptionConstructorsCA1032.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ImplementStandardExceptionConstructorsCA1032 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/instantiateargumentexceptionscorrectlyca2208.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/instantiateargumentexceptionscorrectlyca2208.md new file mode 100644 index 0000000000..f6741baedc --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/instantiateargumentexceptionscorrectlyca2208.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Instantiate argument exceptions correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Instantiate argument exceptions correctly + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.InstantiateArgumentExceptionsCorrectlyCA2208** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/InstantiateArgumentExceptionsCorrectlyCA2208.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InstantiateArgumentExceptionsCorrectlyCA2208 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/interfacemethodsshouldbecallablebychildtypesca1033.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/interfacemethodsshouldbecallablebychildtypesca1033.md new file mode 100644 index 0000000000..61e83263d4 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/interfacemethodsshouldbecallablebychildtypesca1033.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Interface methods should be callable by child types" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Interface methods should be callable by child types + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.InterfaceMethodsShouldBeCallableByChildTypesCA1033** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/InterfaceMethodsShouldBeCallableByChildTypesCA1033.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InterfaceMethodsShouldBeCallableByChildTypesCA1033 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/markattributeswithattributeusageca1018.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/markattributeswithattributeusageca1018.md new file mode 100644 index 0000000000..c77699e40e --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/markattributeswithattributeusageca1018.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Mark attributes with AttributeUsageAttribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark attributes with AttributeUsageAttribute + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.MarkAttributesWithAttributeUsageCA1018** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/MarkAttributesWithAttributeUsageCA1018.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MarkAttributesWithAttributeUsageCA1018 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/marktypeswithserializableca2237.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/marktypeswithserializableca2237.md new file mode 100644 index 0000000000..3d46e41ef5 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/marktypeswithserializableca2237.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Mark ISerializable types with serializable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark ISerializable types with serializable + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.MarkTypesWithSerializableCA2237** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/MarkTypesWithSerializableCA2237.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MarkTypesWithSerializableCA2237 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/operatoroverloadshavenamedalternatesca2225.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/operatoroverloadshavenamedalternatesca2225.md new file mode 100644 index 0000000000..c372d84e82 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/operatoroverloadshavenamedalternatesca2225.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Operator overloads have named alternates" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Operator overloads have named alternates + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OperatorOverloadsHaveNamedAlternatesCA2225** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/OperatorOverloadsHaveNamedAlternatesCA2225.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OperatorOverloadsHaveNamedAlternatesCA2225 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/operatorsshouldhavesymmetricaloverloadsca2226.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/operatorsshouldhavesymmetricaloverloadsca2226.md new file mode 100644 index 0000000000..80595f5afa --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/operatorsshouldhavesymmetricaloverloadsca2226.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Operators should have symmetrical overloads" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Operators should have symmetrical overloads + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OperatorsShouldHaveSymmetricalOverloadsCA2226** + +_A type implements the equality or inequality operator and does not implement the opposite operator._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/OperatorsShouldHaveSymmetricalOverloadsCA2226.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OperatorsShouldHaveSymmetricalOverloadsCA2226 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/overloadoperatorequalsonoverridingvaluetypeequalsca2231.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/overloadoperatorequalsonoverridingvaluetypeequalsca2231.md new file mode 100644 index 0000000000..269bc5f3d7 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/overloadoperatorequalsonoverridingvaluetypeequalsca2231.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Overload operator equals on overriding value type Equals" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Overload operator equals on overriding value type Equals + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OverloadOperatorEqualsOnOverridingValueTypeEqualsCA2231** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/OverloadOperatorEqualsOnOverridingValueTypeEqualsCA2231.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OverloadOperatorEqualsOnOverridingValueTypeEqualsCA2231 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/overridemethodsoncomparabletypesca1036.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/overridemethodsoncomparabletypesca1036.md new file mode 100644 index 0000000000..0fe11c2a4d --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/overridemethodsoncomparabletypesca1036.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Override methods on comparable types" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Override methods on comparable types + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OverrideMethodsOnComparableTypesCA1036** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/OverrideMethodsOnComparableTypesCA1036.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OverrideMethodsOnComparableTypesCA1036 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/parameternamesshouldmatchbasedeclarationca1725.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/parameternamesshouldmatchbasedeclarationca1725.md new file mode 100644 index 0000000000..ab5248e7a8 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/parameternamesshouldmatchbasedeclarationca1725.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Parameter names should match base declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Parameter names should match base declaration + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ParameterNamesShouldMatchBaseDeclarationCA1725** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/ParameterNamesShouldMatchBaseDeclarationCA1725.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterNamesShouldMatchBaseDeclarationCA1725 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferconstcharoverconstunitstringca1834.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferconstcharoverconstunitstringca1834.md new file mode 100644 index 0000000000..13ccf67742 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferconstcharoverconstunitstringca1834.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Consider using 'StringBuilder.Append(char)' when applicable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Consider using 'StringBuilder.Append(char)' when applicable + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferConstCharOverConstUnitStringCA1834** + +_'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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/PreferConstCharOverConstUnitStringCA1834.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PreferConstCharOverConstUnitStringCA1834 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferconverttohexstringoverbitconverterca1872.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferconverttohexstringoverbitconverterca1872.md new file mode 100644 index 0000000000..8df9ba1300 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferconverttohexstringoverbitconverterca1872.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferConvertToHexStringOverBitConverterCA1872** + +_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'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/PreferConvertToHexStringOverBitConverterCA1872.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PreferConvertToHexStringOverBitConverterCA1872 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferstringcontainsoverindexofca2249.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferstringcontainsoverindexofca2249.md new file mode 100644 index 0000000000..1295cc8072 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/preferstringcontainsoverindexofca2249.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Consider using 'string.Contains' instead of 'string.IndexOf'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Consider using 'string.Contains' instead of 'string.IndexOf' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferStringContainsOverIndexOfCA2249** + +_Calls to 'string.IndexOf' where the result is used to check for the presence/absence of a substring can be replaced by 'string.Contains'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/PreferStringContainsOverIndexOfCA2249.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PreferStringContainsOverIndexOfCA2249 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/prefertypedstringbuilderappendoverloadsca1830.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/prefertypedstringbuilderappendoverloadsca1830.md new file mode 100644 index 0000000000..ec67f7a0e4 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/prefertypedstringbuilderappendoverloadsca1830.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefer strongly-typed Append and Insert method overloads on StringBuilder" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefer strongly-typed Append and Insert method overloads on StringBuilder + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferTypedStringBuilderAppendOverloadsCA1830** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/PreferTypedStringBuilderAppendOverloadsCA1830.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PreferTypedStringBuilderAppendOverloadsCA1830 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/providepublicparameterlesssafehandleconstructorca1419.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/providepublicparameterlesssafehandleconstructorca1419.md new file mode 100644 index 0000000000..4b684c9204 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/providepublicparameterlesssafehandleconstructorca1419.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ProvidePublicParameterlessSafeHandleConstructorCA1419** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/ProvidePublicParameterlessSafeHandleConstructorCA1419.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ProvidePublicParameterlessSafeHandleConstructorCA1419 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/removeemptyfinalizersca1821.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/removeemptyfinalizersca1821.md new file mode 100644 index 0000000000..dbca4bda21 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/removeemptyfinalizersca1821.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Remove empty Finalizers" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove empty Finalizers + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.RemoveEmptyFinalizersCA1821** + +_Finalizers should be avoided where possible, to avoid the additional performance overhead involved in tracking object lifetime._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/RemoveEmptyFinalizersCA1821.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveEmptyFinalizersCA1821 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/rethrowtopreservestackdetailsca2200.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/rethrowtopreservestackdetailsca2200.md new file mode 100644 index 0000000000..ac504608c3 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/rethrowtopreservestackdetailsca2200.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Rethrow to preserve stack details" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Rethrow to preserve stack details + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.RethrowToPreserveStackDetailsCA2200** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/RethrowToPreserveStackDetailsCA2200.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RethrowToPreserveStackDetailsCA2200 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/sealinternaltypesca1852.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/sealinternaltypesca1852.md new file mode 100644 index 0000000000..56c342825f --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/sealinternaltypesca1852.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Seal internal types" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Seal internal types + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.SealInternalTypesCA1852** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/SealInternalTypesCA1852.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SealInternalTypesCA1852 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/sealmethodsthatsatisfyprivateinterfacesca2119.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/sealmethodsthatsatisfyprivateinterfacesca2119.md new file mode 100644 index 0000000000..b51fb5f1a1 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/sealmethodsthatsatisfyprivateinterfacesca2119.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Seal methods that satisfy private interfaces" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Seal methods that satisfy private interfaces + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.SealMethodsThatSatisfyPrivateInterfacesCA2119** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/SealMethodsThatSatisfyPrivateInterfacesCA2119.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SealMethodsThatSatisfyPrivateInterfacesCA2119 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/typesthatowndisposablefieldsshouldbedisposableca1001.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/typesthatowndisposablefieldsshouldbedisposableca1001.md new file mode 100644 index 0000000000..d784ec1c2d --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/typesthatowndisposablefieldsshouldbedisposableca1001.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Types that own disposable fields should be disposable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Types that own disposable fields should be disposable + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.TypesThatOwnDisposableFieldsShouldBeDisposableCA1001** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/TypesThatOwnDisposableFieldsShouldBeDisposableCA1001.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TypesThatOwnDisposableFieldsShouldBeDisposableCA1001 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/uriparametersshouldnotbestringsca1054.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/uriparametersshouldnotbestringsca1054.md new file mode 100644 index 0000000000..e7581e7cd7 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/uriparametersshouldnotbestringsca1054.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "URI-like parameters should not be strings" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# URI-like parameters should not be strings + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UriParametersShouldNotBeStringsCA1054** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UriParametersShouldNotBeStringsCA1054.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UriParametersShouldNotBeStringsCA1054 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usecancellationtokenthrowifcancellationrequestedca2250.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usecancellationtokenthrowifcancellationrequestedca2250.md new file mode 100644 index 0000000000..6a68a28fbd --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usecancellationtokenthrowifcancellationrequestedca2250.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use 'ThrowIfCancellationRequested'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'ThrowIfCancellationRequested' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseCancellationTokenThrowIfCancellationRequestedCA2250** + +_'ThrowIfCancellationRequested' automatically checks whether the token has been canceled, and throws an 'OperationCanceledException' if it has._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseCancellationTokenThrowIfCancellationRequestedCA2250.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseCancellationTokenThrowIfCancellationRequestedCA2250 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1837.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1837.md new file mode 100644 index 0000000000..2e06c40638 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1837.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use 'Environment.ProcessId'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'Environment.ProcessId' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1837** + +_'Environment.ProcessId' is simpler and faster than 'Process.GetCurrentProcess().Id'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseEnvironmentMembersCA1837.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseEnvironmentMembersCA1837 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1839.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1839.md new file mode 100644 index 0000000000..41ca67c767 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1839.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use 'Environment.ProcessPath'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'Environment.ProcessPath' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1839** + +_'Environment.ProcessPath' is simpler and faster than 'Process.GetCurrentProcess().MainModule.FileName'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseEnvironmentMembersCA1839.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseEnvironmentMembersCA1839 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1840.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1840.md new file mode 100644 index 0000000000..f7298e9c2c --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useenvironmentmembersca1840.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use 'Environment.CurrentManagedThreadId'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'Environment.CurrentManagedThreadId' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1840** + +_'Environment.CurrentManagedThreadId' is simpler and faster than 'Thread.CurrentThread.ManagedThreadId'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseEnvironmentMembersCA1840.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseEnvironmentMembersCA1840 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1510.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1510.md new file mode 100644 index 0000000000..26563a4add --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1510.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use ArgumentNullException throw helper" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use ArgumentNullException throw helper + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1510** + +_Throw helpers are simpler and more efficient than an if block constructing a new exception instance._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseExceptionThrowHelpersCA1510.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExceptionThrowHelpersCA1510 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1511.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1511.md new file mode 100644 index 0000000000..3803515823 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1511.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use ArgumentException throw helper" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use ArgumentException throw helper + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1511** + +_Throw helpers are simpler and more efficient than an if block constructing a new exception instance._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseExceptionThrowHelpersCA1511.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExceptionThrowHelpersCA1511 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1512.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1512.md new file mode 100644 index 0000000000..3f81c1b445 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1512.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use ArgumentOutOfRangeException throw helper" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use ArgumentOutOfRangeException throw helper + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1512** + +_Throw helpers are simpler and more efficient than an if block constructing a new exception instance._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseExceptionThrowHelpersCA1512.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExceptionThrowHelpersCA1512 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1513.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1513.md new file mode 100644 index 0000000000..c356a55bd1 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/useexceptionthrowhelpersca1513.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use ObjectDisposedException throw helper" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use ObjectDisposedException throw helper + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1513** + +_Throw helpers are simpler and more efficient than an if block constructing a new exception instance._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseExceptionThrowHelpersCA1513.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExceptionThrowHelpersCA1513 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usenameofinplaceofstringca1507.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usenameofinplaceofstringca1507.md new file mode 100644 index 0000000000..e248d45fb2 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usenameofinplaceofstringca1507.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use nameof to express symbol names" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use nameof to express symbol names + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseNameOfInPlaceOfStringCA1507** + +_Using nameof helps keep your code valid when refactoring._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseNameOfInPlaceOfStringCA1507.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseNameOfInPlaceOfStringCA1507 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usestringequalsoverstringcompareca2251.md b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usestringequalsoverstringcompareca2251.md new file mode 100644 index 0000000000..c55e2cf9c9 --- /dev/null +++ b/docs/recipes/csharp/recipes/microsoft/codeanalysis/netanalyzers/usestringequalsoverstringcompareca2251.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use 'string.Equals'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'string.Equals' + +**org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseStringEqualsOverStringCompareCA2251** + +_It is both clearer and likely faster to use 'string.Equals' instead of comparing the result of 'string.Compare' to zero._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/microsoft/codeanalysis/netanalyzers/UseStringEqualsOverStringCompareCA2251.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringEqualsOverStringCompareCA2251 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/README.md b/docs/recipes/csharp/recipes/roslynator/README.md new file mode 100644 index 0000000000..7d2bd93bc9 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/README.md @@ -0,0 +1,7 @@ +# Roslynator + +## Categories + +* [Analyzers](/recipes/csharp/recipes/roslynator/analyzers) + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/README.md b/docs/recipes/csharp/recipes/roslynator/analyzers/README.md new file mode 100644 index 0000000000..7a3ff9f5fa --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/README.md @@ -0,0 +1,214 @@ +# Analyzers + +## Recipes + +* [Abstract type should not have public constructors](./constructordeclarationrcs1160.md) +* [Add 'param' element to documentation comment](./singlelinedocumentationcommenttriviarcs1141.md) +* [Add 'static' modifier to all partial class declarations](./classdeclarationrcs1108.md) +* [Add 'typeparam' element to documentation comment](./singlelinedocumentationcommenttriviarcs1142.md) +* [Add braces](./addbracesrcs1007.md) +* [Add braces (when expression spans over multiple lines)](./addbracesrcs1001.md) +* [Add braces to if-else](./addbracesrcs1126.md) +* [Add braces to if-else (when expression spans over multiple lines)](./addbracestoifelsercs1003.md) +* [Add braces to switch section with multiple statements](./switchsectionrcs1111.md) +* [Add exception to documentation comment](./addexceptiontodocumentationcommentrcs1140.md) +* [Add or remove region name](./endregiondirectivetriviarcs1189.md) +* [Add paragraph to documentation comment](./addparagraphtodocumentationcommentrcs1226.md) +* [Add parentheses when necessary](./addparentheseswhennecessaryrcs1123.md) +* [Add summary element to documentation comment](./documentationcommentrcs1139.md) +* [Add/remove 'ConfigureAwait(false)' call](./awaitexpressionrcs1090.md) +* [Add/remove accessibility modifiers](./memberdeclarationrcs1018.md) +* [Add/remove parentheses from condition in conditional operator](./expressionrcs1051.md) +* [Add/remove trailing comma](./addorremovetrailingcommarcs1260.md) +* [Avoid NullReferenceException](./avoidnullreferenceexceptionrcs1202.md) +* [Avoid locking on publicly accessible instance](./lockstatementrcs1059.md) +* [Avoid nested ?: operators](./conditionalexpressionrcs1238.md) +* [Avoid unnecessary boxing of value type](./avoidboxingofvaluetypercs1198.md) +* [Avoid usage of using alias directive](./usingdirectivercs1056.md) +* [Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'](./invocationexpressionrcs1200.md) +* [Call extension method as instance method](./invocationexpressionrcs1196.md) +* [Combine 'Enumerable.Where' method chain](./invocationexpressionrcs1112.md) +* [Composite enum value contains undefined flag](./compositeenumvaluecontainsundefinedflagrcs1157.md) +* [Constant values should be placed on right side of comparisons](./binaryexpressionrcs1098.md) +* [Convert 'if' to 'return' statement](./ifstatementrcs1073.md) +* [Convert 'if' to assignment](./ifstatementrcs1103.md) +* [Convert comment to documentation comment](./memberdeclarationrcs1181.md) +* [Convert interpolated string to concatenation](./interpolatedstringrcs1217.md) +* [Convert lambda expression body to expression body](./convertlambdaexpressionbodytoexpressionbodyrcs1021.md) +* [Declare each attribute separately](./declareeachattributeseparatelyrcs1052.md) +* [Declare each type in separate file](./extractmembertonewdocumentrcs1060.md) +* [Declare enum member with zero value (when enum has FlagsAttribute)](./declareenummemberwithzerovaluercs1135.md) +* [Declare enum value as combination of names](./enummemberdeclarationrcs1191.md) +* [Declare type inside namespace](./declaretypeinsidenamespacercs1110.md) +* [Declare using directive on top level](./namespacedeclarationrcs1094.md) +* [Default label should be the last label in a switch section](./switchsectionrcs1099.md) +* [Do not pass non-read-only struct by read-only reference](./parameterrcs1242.md) +* [Duplicate enum value](./enummemberdeclarationrcs1234.md) +* [Duplicate word in a comment](./duplicatewordincommentrcs1243.md) +* [Enum should declare explicit values](./enumdeclarationrcs1161.md) +* [Expression is always equal to true/false](./expressionrcs1215.md) +* [File contains no code](./documentrcs1093.md) +* [Fix documentation comment tag](./xmlnodercs1247.md) +* [Format documentation comment summary](./singlelinedocumentationcommenttriviarcs1253.md) +* [Implement exception constructors](./classdeclarationrcs1194.md) +* [Implement non-generic counterpart](./implementnongenericcounterpartrcs1241.md) +* [Include/omit parentheses when creating new object](./addorremoveparentheseswhencreatingnewobjectrcs1050.md) +* [Inline lazy initialization](./statementrcs1180.md) +* [Inline local variable](./localdeclarationstatementrcs1124.md) +* [Invalid argument null check](./invalidargumentnullcheckrcs1256.md) +* [Invalid reference in a documentation comment](./removeelementindocumentationcommentrcs1263.md) +* [Join string expressions](./binaryexpressionrcs1190.md) +* [Make class sealed](./classdeclarationrcs1225.md) +* [Make class static](./classdeclarationrcs1102.md) +* [Make field read-only](./memberdeclarationrcs1169.md) +* [Make method an extension method](./memberdeclarationrcs1224.md) +* [Make parameter ref read-only](./parameterrcs1231.md) +* [Mark local variable as const](./marklocalvariableasconstrcs1118.md) +* [Mark publicly visible type with DebuggerDisplay attribute](./marktypewithdebuggerdisplayattributercs1223.md) +* [Merge 'else' with nested 'if'](./elseclausercs1006.md) +* [Merge 'if' with nested 'if'](./ifstatementrcs1061.md) +* [Merge preprocessor directives](./directivetriviarcs1222.md) +* [Merge switch sections with equivalent content](./switchsectionrcs1136.md) +* [Normalize format of enum flag value](./enummemberdeclarationrcs1254.md) +* [Normalize null check](./normalizenullcheckproviderrcs1248.md) +* [Normalize usage of infinite loop](./normalizeusageofinfinitelooprcs1252.md) +* [Operator is unnecessary](./binaryexpressionrcs1240.md) +* [Optimize LINQ method call](./optimizelinqmethodcallrcs1077.md) +* [Optimize StringBuilder.Append/AppendLine call](./optimizestringbuilderappendcallrcs1197.md) +* [Optimize method call](./optimizemethodcallrcs1235.md) +* [Order elements in documentation comment](./orderelementsindocumentationcommentrcs1232.md) +* [Order modifiers](./memberdeclarationrcs1019.md) +* [Order named arguments according to the order of parameters](./baseargumentlistrcs1205.md) +* [Order type parameter constraints](./ordertypeparameterconstraintsrcs1209.md) +* [Overriding member should not change 'params' modifier](./parameterrcs1193.md) +* [Parameter name differs from base name](./parameternamediffersfrombasercs1168.md) +* [Reduce 'if' nesting](./ifstatementrcs1208.md) +* [Remove 'partial' modifier from type with a single part](./removepartialmodifierfromtypewithsinglepartrcs1043.md) +* [Remove argument list from attribute](./attributeargumentlistrcs1039.md) +* [Remove braces](./removebracesrcs1002.md) +* [Remove braces from if-else](./removebracesfromifelsercs1004.md) +* [Remove empty syntax](./removeemptysyntaxrcs1259.md) +* [Remove enum default underlying type](./removeenumdefaultbasetypercs1042.md) +* [Remove original exception from throw statement](./removeoriginalexceptionrcs1044.md) +* [Remove redundant 'ToCharArray' call](./invocationexpressionrcs1107.md) +* [Remove redundant 'ToString' call](./invocationexpressionrcs1097.md) +* [Remove redundant 'as' operator](./binaryexpressionrcs1145.md) +* [Remove redundant 'sealed' modifier](./memberdeclarationrcs1034.md) +* [Remove redundant Dispose/Close call](./statementrcs1133.md) +* [Remove redundant assignment](./removeredundantassignmentrcs1212.md) +* [Remove redundant async/await](./removeredundantasyncawaitrcs1174.md) +* [Remove redundant auto-property initialization](./propertydeclarationrcs1188.md) +* [Remove redundant base constructor call](./constructordeclarationrcs1071.md) +* [Remove redundant base interface](./basetypercs1182.md) +* [Remove redundant boolean literal](./removeredundantbooleanliteralrcs1033.md) +* [Remove redundant cast](./removeredundantcastrcs1151.md) +* [Remove redundant catch block](./removeredundantcatchblockrcs1265.md) +* [Remove redundant constructor](./constructordeclarationrcs1074.md) +* [Remove redundant default switch section](./switchsectionrcs1070.md) +* [Remove redundant delegate creation](./assignmentexpressionrcs1114.md) +* [Remove redundant field initialization](./variabledeclaratorrcs1129.md) +* [Remove redundant overriding member](./memberdeclarationrcs1132.md) +* [Remove redundant parentheses](./parenthesizedexpressionrcs1032.md) +* [Remove redundant statement](./statementrcs1134.md) +* [Remove trailing white-space](./whitespacetriviarcs1037.md) +* [Remove unnecessary 'else'](./removeunnecessaryelsercs1211.md) +* [Remove unnecessary braces from record declaration](./removeunnecessarybracesrcs1251.md) +* [Remove unnecessary braces in switch section](./blockrcs1031.md) +* [Remove unnecessary case label](./caseswitchlabelrcs1069.md) +* [Remove unused member declaration](./unusedmemberrcs1213.md) +* [Resource can be disposed asynchronously](./disposeresourceasynchronouslyrcs1261.md) +* [Return completed task instead of returning null](./returncompletedtaskinsteadofnullrcs1210.md) +* [Simplify 'default' expression](./defaultexpressionrcs1244.md) +* [Simplify Nullable to T?](./simplifynullableoftrcs1020.md) +* [Simplify argument null check](./ifstatementrcs1255.md) +* [Simplify boolean comparison](./simplifybooleancomparisonrcs1049.md) +* [Simplify coalesce expression](./binaryexpressionrcs1143.md) +* [Simplify code branching](./simplifycodebranchingrcs1218.md) +* [Simplify conditional expression](./conditionalexpressionrcs1104.md) +* [Simplify lazy initialization](./blockrcs1171.md) +* [Simplify logical negation](./simplifylogicalnegationrcs1068.md) +* [Simplify nested using statement](./simplifynestedusingstatementrcs1005.md) +* [Simplify numeric comparison](./binaryexpressionrcs1268.md) +* [Sort enum members](./enumdeclarationrcs1154.md) +* [Split variable declaration](./variabledeclarationrcs1081.md) +* [Unconstrained type parameter checked for null](./binaryexpressionrcs1165.md) +* [Unnecessary assignment](./unnecessaryassignmentrcs1179.md) +* [Unnecessary enum flag](./unnecessaryenumflagrcs1258.md) +* [Unnecessary explicit use of enumerator](./unnecessaryexplicituseofenumeratorrcs1230.md) +* [Unnecessary interpolated string](./interpolatedstringrcs1214.md) +* [Unnecessary interpolation](./interpolationrcs1105.md) +* [Unnecessary null check](./binaryexpressionrcs1199.md) +* [Unnecessary null-forgiving operator](./tokenrcs1249.md) +* [Unnecessary raw string literal](./rawstringliteralrcs1262.md) +* [Unnecessary semicolon at the end of declaration](./memberdeclarationrcs1055.md) +* [Unnecessary unsafe context](./unnecessaryunsafecontextrcs1216.md) +* [Unnecessary usage of verbatim string literal](./unnecessaryusageofverbatimstringliteralrcs1192.md) +* [Unused element in a documentation comment](./removeelementindocumentationcommentrcs1228.md) +* [Unused parameter](./unusedparameterrcs1163.md) +* [Unused type parameter](./typeparameterrcs1164.md) +* [Use "" or 'string.Empty'](./useemptystringliteralorstringemptyrcs1078.md) +* [Use 'Count/Length' property instead of 'Any' method](./invocationexpressionrcs1080.md) +* [Use 'HasFlag' method or bitwise operator](./usehasflagmethodorbitwiseoperatorrcs1096.md) +* [Use 'for' statement instead of 'while' statement](./whilestatementrcs1239.md) +* [Use 'is' operator instead of 'as' operator](./useisoperatorinsteadofasoperatorrcs1172.md) +* [Use 'string.IsNullOrEmpty' method](./binaryexpressionrcs1113.md) +* [Use 'var' or explicit type](./usevarorexplicittypercs1264.md) +* [Use --/++ operator instead of assignment](./assignmentexpressionrcs1089.md) +* [Use AttributeUsageAttribute](./classdeclarationrcs1203.md) +* [Use EventArgs.Empty](./objectcreationexpressionrcs1204.md) +* [Use EventHandler](./typercs1159.md) +* [Use Regex instance instead of static method](./useregexinstanceinsteadofstaticmethodrcs1186.md) +* [Use StringComparison when comparing strings](./usestringcomparisonrcs1155.md) +* [Use ^ operator](./binaryexpressionrcs1195.md) +* [Use anonymous function or method group](./useanonymousfunctionormethodgrouprcs1207.md) +* [Use async/await when necessary](./useasyncawaitrcs1229.md) +* [Use auto-implemented property](./useautopropertyrcs1085.md) +* [Use block body or expression body](./useblockbodyorexpressionbodyrcs1016.md) +* [Use coalesce expression](./usecoalesceexpressionrcs1128.md) +* [Use coalesce expression instead of 'if'](./ifstatementrcs1173.md) +* [Use coalesce expression instead of conditional expression](./conditionalexpressionrcs1084.md) +* [Use compound assignment](./usecompoundassignmentrcs1058.md) +* [Use conditional access](./useconditionalaccessrcs1146.md) +* [Use conditional access instead of conditional expression](./conditionalexpressionrcs1206.md) +* [Use constant instead of field](./memberdeclarationrcs1187.md) +* [Use element access](./optimizelinqmethodcallrcs1246.md) +* [Use enum field explicitly](./castexpressionrcs1257.md) +* [Use exception filter](./ifstatementrcs1236.md) +* [Use explicitly/implicitly typed array](./useexplicitlyorimplicitlytypedarrayrcs1014.md) +* [Use implicit/explicit object creation](./useimplicitorexplicitobjectcreationrcs1250.md) +* [Use lambda expression instead of anonymous method](./anonymousmethodrcs1048.md) +* [Use method chaining](./statementrcs1201.md) +* [Use nameof operator](./usenameofoperatorrcs1015.md) +* [Use pattern matching instead of combination of 'as' operator and null check](./usepatternmatchinginsteadofasandnullcheckrcs1221.md) +* [Use pattern matching instead of combination of 'is' operator and cast operator](./usepatternmatchinginsteadofisandcastrcs1220.md) +* [Use predefined type](./usepredefinedtypercs1013.md) +* [Use raw string literal](./rawstringliteralrcs1266.md) +* [Use read-only auto-implemented property](./memberdeclarationrcs1170.md) +* [Use short-circuiting operator](./binaryexpressionrcs1233.md) +* [Use string interpolation instead of 'string.Concat'](./invocationexpressionrcs1267.md) +* [Use string.Length instead of comparison with empty string](./binaryexpressionrcs1156.md) +* [Validate arguments correctly](./validateargumentscorrectlyrcs1227.md) +* [Value type object is never equal to null](./binaryexpressionrcs1166.md) +* [[deprecated] Avoid usage of do statement to create an infinite loop](./dostatementrcs1063.md) +* [[deprecated] Avoid usage of for statement to create an infinite loop](./forstatementrcs1064.md) +* [[deprecated] Avoid usage of while statement to create an infinite loop](./whilestatementrcs1065.md) +* [[deprecated] Format documentation summary on a single line](./singlelinedocumentationcommenttriviarcs1100.md) +* [[deprecated] Format documentation summary on multiple lines](./singlelinedocumentationcommenttriviarcs1101.md) +* [[deprecated] Remove empty 'else' clause](./elseclausercs1040.md) +* [[deprecated] Remove empty 'finally' clause](./finallyclausercs1066.md) +* [[deprecated] Remove empty destructor](./destructordeclarationrcs1106.md) +* [[deprecated] Remove empty initializer](./removeemptyinitializerrcs1041.md) +* [[deprecated] Remove empty namespace declaration](./namespacedeclarationrcs1072.md) +* [[deprecated] Remove empty region](./regiondirectivetriviarcs1091.md) +* [[deprecated] Remove empty statement](./emptystatementrcs1038.md) +* [[deprecated] Remove redundant comma in initializer](./initializerrcs1035.md) +* [[deprecated] Remove unnecessary blank line](./whitespacetriviarcs1036.md) +* [[deprecated] Use 'var' instead of explicit type (in foreach)](./usevarinsteadofexplicittypercs1177.md) +* [[deprecated] Use 'var' instead of explicit type (when the type is not obvious)](./usevarinsteadofexplicittypercs1176.md) +* [[deprecated] Use 'var' instead of explicit type (when the type is obvious)](./usevarinsteadofexplicittypercs1010.md) +* [[deprecated] Use bit shift operator](./enumdeclarationrcs1237.md) +* [[deprecated] Use explicit type instead of 'var' (foreach variable)](./useexplicittypeinsteadofvarinforeachrcs1009.md) +* [[deprecated] Use explicit type instead of 'var' (when the type is not obvious)](./useexplicittypeinsteadofvarrcs1008.md) +* [[deprecated] Use explicit type instead of 'var' (when the type is obvious)](./useexplicittypeinsteadofvarrcs1012.md) + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1001.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1001.md new file mode 100644 index 0000000000..586e53668f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1001.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add braces (when expression spans over multiple lines)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add braces (when expression spans over multiple lines) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1001** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddBracesRCS1001.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddBracesRCS1001 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1007.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1007.md new file mode 100644 index 0000000000..4d9c8567fd --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1007.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add braces" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add braces + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1007** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddBracesRCS1007.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddBracesRCS1007 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1126.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1126.md new file mode 100644 index 0000000000..816609a968 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracesrcs1126.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add braces to if-else" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add braces to if-else + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1126** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddBracesRCS1126.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddBracesRCS1126 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addbracestoifelsercs1003.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracestoifelsercs1003.md new file mode 100644 index 0000000000..42c0d24edf --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addbracestoifelsercs1003.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add braces to if-else (when expression spans over multiple lines)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add braces to if-else (when expression spans over multiple lines) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesToIfElseRCS1003** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddBracesToIfElseRCS1003.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddBracesToIfElseRCS1003 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addexceptiontodocumentationcommentrcs1140.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addexceptiontodocumentationcommentrcs1140.md new file mode 100644 index 0000000000..94a4c529c7 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addexceptiontodocumentationcommentrcs1140.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add exception to documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add exception to documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddExceptionToDocumentationCommentRCS1140** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddExceptionToDocumentationCommentRCS1140.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddExceptionToDocumentationCommentRCS1140 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addorremoveparentheseswhencreatingnewobjectrcs1050.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addorremoveparentheseswhencreatingnewobjectrcs1050.md new file mode 100644 index 0000000000..205a113160 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addorremoveparentheseswhencreatingnewobjectrcs1050.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Include/omit parentheses when creating new object" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Include/omit parentheses when creating new object + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddOrRemoveParenthesesWhenCreatingNewObjectRCS1050** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddOrRemoveParenthesesWhenCreatingNewObjectRCS1050.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddOrRemoveParenthesesWhenCreatingNewObjectRCS1050 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addorremovetrailingcommarcs1260.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addorremovetrailingcommarcs1260.md new file mode 100644 index 0000000000..18c5892720 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addorremovetrailingcommarcs1260.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add/remove trailing comma" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add/remove trailing comma + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddOrRemoveTrailingCommaRCS1260** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddOrRemoveTrailingCommaRCS1260.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddOrRemoveTrailingCommaRCS1260 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addparagraphtodocumentationcommentrcs1226.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addparagraphtodocumentationcommentrcs1226.md new file mode 100644 index 0000000000..781896b15d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addparagraphtodocumentationcommentrcs1226.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add paragraph to documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add paragraph to documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddParagraphToDocumentationCommentRCS1226** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddParagraphToDocumentationCommentRCS1226.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddParagraphToDocumentationCommentRCS1226 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/addparentheseswhennecessaryrcs1123.md b/docs/recipes/csharp/recipes/roslynator/analyzers/addparentheseswhennecessaryrcs1123.md new file mode 100644 index 0000000000..ab9712b7af --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/addparentheseswhennecessaryrcs1123.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add parentheses when necessary" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add parentheses when necessary + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AddParenthesesWhenNecessaryRCS1123** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AddParenthesesWhenNecessaryRCS1123.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddParenthesesWhenNecessaryRCS1123 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/anonymousmethodrcs1048.md b/docs/recipes/csharp/recipes/roslynator/analyzers/anonymousmethodrcs1048.md new file mode 100644 index 0000000000..6238820d57 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/anonymousmethodrcs1048.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use lambda expression instead of anonymous method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use lambda expression instead of anonymous method + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AnonymousMethodRCS1048** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AnonymousMethodRCS1048.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AnonymousMethodRCS1048 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/assignmentexpressionrcs1089.md b/docs/recipes/csharp/recipes/roslynator/analyzers/assignmentexpressionrcs1089.md new file mode 100644 index 0000000000..368118a407 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/assignmentexpressionrcs1089.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use --/++ operator instead of assignment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use --/++ operator instead of assignment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AssignmentExpressionRCS1089** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AssignmentExpressionRCS1089.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AssignmentExpressionRCS1089 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/assignmentexpressionrcs1114.md b/docs/recipes/csharp/recipes/roslynator/analyzers/assignmentexpressionrcs1114.md new file mode 100644 index 0000000000..f4aa05eb81 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/assignmentexpressionrcs1114.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant delegate creation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant delegate creation + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AssignmentExpressionRCS1114** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AssignmentExpressionRCS1114.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AssignmentExpressionRCS1114 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/attributeargumentlistrcs1039.md b/docs/recipes/csharp/recipes/roslynator/analyzers/attributeargumentlistrcs1039.md new file mode 100644 index 0000000000..0d34c5977b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/attributeargumentlistrcs1039.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove argument list from attribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove argument list from attribute + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AttributeArgumentListRCS1039** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AttributeArgumentListRCS1039.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AttributeArgumentListRCS1039 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/avoidboxingofvaluetypercs1198.md b/docs/recipes/csharp/recipes/roslynator/analyzers/avoidboxingofvaluetypercs1198.md new file mode 100644 index 0000000000..22ea916eb6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/avoidboxingofvaluetypercs1198.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid unnecessary boxing of value type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid unnecessary boxing of value type + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AvoidBoxingOfValueTypeRCS1198** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AvoidBoxingOfValueTypeRCS1198.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidBoxingOfValueTypeRCS1198 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/avoidnullreferenceexceptionrcs1202.md b/docs/recipes/csharp/recipes/roslynator/analyzers/avoidnullreferenceexceptionrcs1202.md new file mode 100644 index 0000000000..10da292e47 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/avoidnullreferenceexceptionrcs1202.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid NullReferenceException" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid NullReferenceException + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AvoidNullReferenceExceptionRCS1202** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AvoidNullReferenceExceptionRCS1202.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AvoidNullReferenceExceptionRCS1202 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/awaitexpressionrcs1090.md b/docs/recipes/csharp/recipes/roslynator/analyzers/awaitexpressionrcs1090.md new file mode 100644 index 0000000000..aa9738d918 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/awaitexpressionrcs1090.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add/remove 'ConfigureAwait(false)' call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add/remove 'ConfigureAwait(false)' call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.AwaitExpressionRCS1090** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/AwaitExpressionRCS1090.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AwaitExpressionRCS1090 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/baseargumentlistrcs1205.md b/docs/recipes/csharp/recipes/roslynator/analyzers/baseargumentlistrcs1205.md new file mode 100644 index 0000000000..7b43bd0ef7 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/baseargumentlistrcs1205.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Order named arguments according to the order of parameters" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Order named arguments according to the order of parameters + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BaseArgumentListRCS1205** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BaseArgumentListRCS1205.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BaseArgumentListRCS1205 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/basetypercs1182.md b/docs/recipes/csharp/recipes/roslynator/analyzers/basetypercs1182.md new file mode 100644 index 0000000000..42659ca47a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/basetypercs1182.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant base interface" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant base interface + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BaseTypeRCS1182** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BaseTypeRCS1182.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BaseTypeRCS1182 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1098.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1098.md new file mode 100644 index 0000000000..bfb2be602d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1098.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Constant values should be placed on right side of comparisons" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Constant values should be placed on right side of comparisons + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1098** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1098.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1098 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1113.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1113.md new file mode 100644 index 0000000000..b97cefac01 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1113.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'string.IsNullOrEmpty' method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'string.IsNullOrEmpty' method + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1113** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1113.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1113 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1143.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1143.md new file mode 100644 index 0000000000..6f9052e5da --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1143.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify coalesce expression" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify coalesce expression + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1143** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1143.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1143 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1145.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1145.md new file mode 100644 index 0000000000..50dd63cc37 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1145.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant 'as' operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant 'as' operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1145** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1145.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1145 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1156.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1156.md new file mode 100644 index 0000000000..1c39e4b28f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1156.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use string.Length instead of comparison with empty string" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use string.Length instead of comparison with empty string + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1156** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1156.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1156 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1165.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1165.md new file mode 100644 index 0000000000..434b921079 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1165.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unconstrained type parameter checked for null" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unconstrained type parameter checked for null + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1165** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1165.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1165 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1166.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1166.md new file mode 100644 index 0000000000..abe4665cc1 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1166.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Value type object is never equal to null" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Value type object is never equal to null + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1166** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1166.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1166 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1190.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1190.md new file mode 100644 index 0000000000..901f99cbc6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1190.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Join string expressions" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Join string expressions + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1190** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1190.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1190 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1195.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1195.md new file mode 100644 index 0000000000..716692bae1 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1195.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use ^ operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use ^ operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1195** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1195.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1195 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1199.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1199.md new file mode 100644 index 0000000000..5c7820fdc6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1199.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary null check + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1199** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1199.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1199 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1233.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1233.md new file mode 100644 index 0000000000..8f7e5a073f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1233.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use short-circuiting operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use short-circuiting operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1233** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1233.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1233 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1240.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1240.md new file mode 100644 index 0000000000..faa92d1450 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1240.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Operator is unnecessary" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Operator is unnecessary + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1240** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1240.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1240 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1268.md b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1268.md new file mode 100644 index 0000000000..6b2de62ae3 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/binaryexpressionrcs1268.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify numeric comparison" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify numeric comparison + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1268** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BinaryExpressionRCS1268.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BinaryExpressionRCS1268 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/blockrcs1031.md b/docs/recipes/csharp/recipes/roslynator/analyzers/blockrcs1031.md new file mode 100644 index 0000000000..7ab34b1c72 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/blockrcs1031.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove unnecessary braces in switch section" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove unnecessary braces in switch section + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BlockRCS1031** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BlockRCS1031.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BlockRCS1031 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/blockrcs1171.md b/docs/recipes/csharp/recipes/roslynator/analyzers/blockrcs1171.md new file mode 100644 index 0000000000..d493cf62a0 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/blockrcs1171.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify lazy initialization" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify lazy initialization + +**org.openrewrite.csharp.recipes.roslynator.analyzers.BlockRCS1171** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/BlockRCS1171.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe BlockRCS1171 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/caseswitchlabelrcs1069.md b/docs/recipes/csharp/recipes/roslynator/analyzers/caseswitchlabelrcs1069.md new file mode 100644 index 0000000000..35eaea8a6a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/caseswitchlabelrcs1069.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove unnecessary case label" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove unnecessary case label + +**org.openrewrite.csharp.recipes.roslynator.analyzers.CaseSwitchLabelRCS1069** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/CaseSwitchLabelRCS1069.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CaseSwitchLabelRCS1069 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/castexpressionrcs1257.md b/docs/recipes/csharp/recipes/roslynator/analyzers/castexpressionrcs1257.md new file mode 100644 index 0000000000..8ccc62c0ad --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/castexpressionrcs1257.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use enum field explicitly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use enum field explicitly + +**org.openrewrite.csharp.recipes.roslynator.analyzers.CastExpressionRCS1257** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/CastExpressionRCS1257.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CastExpressionRCS1257 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1102.md b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1102.md new file mode 100644 index 0000000000..fe431062a3 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1102.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make class static" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make class static + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1102** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ClassDeclarationRCS1102.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ClassDeclarationRCS1102 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1108.md b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1108.md new file mode 100644 index 0000000000..2f10a4f01c --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1108.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add 'static' modifier to all partial class declarations" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add 'static' modifier to all partial class declarations + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1108** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ClassDeclarationRCS1108.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ClassDeclarationRCS1108 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1194.md b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1194.md new file mode 100644 index 0000000000..1676cbc0fe --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1194.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Implement exception constructors" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Implement exception constructors + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1194** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ClassDeclarationRCS1194.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ClassDeclarationRCS1194 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1203.md b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1203.md new file mode 100644 index 0000000000..ba84b2ba49 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1203.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use AttributeUsageAttribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use AttributeUsageAttribute + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1203** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ClassDeclarationRCS1203.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ClassDeclarationRCS1203 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1225.md b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1225.md new file mode 100644 index 0000000000..abe96b7f24 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/classdeclarationrcs1225.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make class sealed" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make class sealed + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1225** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ClassDeclarationRCS1225.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ClassDeclarationRCS1225 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/compositeenumvaluecontainsundefinedflagrcs1157.md b/docs/recipes/csharp/recipes/roslynator/analyzers/compositeenumvaluecontainsundefinedflagrcs1157.md new file mode 100644 index 0000000000..c288fa86cb --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/compositeenumvaluecontainsundefinedflagrcs1157.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Composite enum value contains undefined flag" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Composite enum value contains undefined flag + +**org.openrewrite.csharp.recipes.roslynator.analyzers.CompositeEnumValueContainsUndefinedFlagRCS1157** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/CompositeEnumValueContainsUndefinedFlagRCS1157.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CompositeEnumValueContainsUndefinedFlagRCS1157 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1084.md b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1084.md new file mode 100644 index 0000000000..2e6551768f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1084.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use coalesce expression instead of conditional expression" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use coalesce expression instead of conditional expression + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1084** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConditionalExpressionRCS1084.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConditionalExpressionRCS1084 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1104.md b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1104.md new file mode 100644 index 0000000000..a7a1f31ee0 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1104.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify conditional expression" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify conditional expression + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1104** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConditionalExpressionRCS1104.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConditionalExpressionRCS1104 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1206.md b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1206.md new file mode 100644 index 0000000000..4f7a56e52a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1206.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use conditional access instead of conditional expression" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use conditional access instead of conditional expression + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1206** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConditionalExpressionRCS1206.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConditionalExpressionRCS1206 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1238.md b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1238.md new file mode 100644 index 0000000000..8d0f7b0102 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/conditionalexpressionrcs1238.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid nested ?: operators" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid nested ?: operators + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1238** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConditionalExpressionRCS1238.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConditionalExpressionRCS1238 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1071.md b/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1071.md new file mode 100644 index 0000000000..9db1b457b8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1071.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant base constructor call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant base constructor call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1071** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConstructorDeclarationRCS1071.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConstructorDeclarationRCS1071 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1074.md b/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1074.md new file mode 100644 index 0000000000..d9e3d9d881 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1074.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant constructor" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant constructor + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1074** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConstructorDeclarationRCS1074.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConstructorDeclarationRCS1074 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1160.md b/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1160.md new file mode 100644 index 0000000000..00fe94770f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/constructordeclarationrcs1160.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Abstract type should not have public constructors" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Abstract type should not have public constructors + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1160** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConstructorDeclarationRCS1160.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConstructorDeclarationRCS1160 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/convertlambdaexpressionbodytoexpressionbodyrcs1021.md b/docs/recipes/csharp/recipes/roslynator/analyzers/convertlambdaexpressionbodytoexpressionbodyrcs1021.md new file mode 100644 index 0000000000..1a6da9f392 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/convertlambdaexpressionbodytoexpressionbodyrcs1021.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Convert lambda expression body to expression body" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Convert lambda expression body to expression body + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ConvertLambdaExpressionBodyToExpressionBodyRCS1021** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ConvertLambdaExpressionBodyToExpressionBodyRCS1021.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConvertLambdaExpressionBodyToExpressionBodyRCS1021 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/declareeachattributeseparatelyrcs1052.md b/docs/recipes/csharp/recipes/roslynator/analyzers/declareeachattributeseparatelyrcs1052.md new file mode 100644 index 0000000000..f0ae4aaf6b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/declareeachattributeseparatelyrcs1052.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Declare each attribute separately" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declare each attribute separately + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareEachAttributeSeparatelyRCS1052** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DeclareEachAttributeSeparatelyRCS1052.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DeclareEachAttributeSeparatelyRCS1052 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/declareenummemberwithzerovaluercs1135.md b/docs/recipes/csharp/recipes/roslynator/analyzers/declareenummemberwithzerovaluercs1135.md new file mode 100644 index 0000000000..6bba6e2e10 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/declareenummemberwithzerovaluercs1135.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Declare enum member with zero value (when enum has FlagsAttribute)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declare enum member with zero value (when enum has FlagsAttribute) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareEnumMemberWithZeroValueRCS1135** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DeclareEnumMemberWithZeroValueRCS1135.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DeclareEnumMemberWithZeroValueRCS1135 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/declaretypeinsidenamespacercs1110.md b/docs/recipes/csharp/recipes/roslynator/analyzers/declaretypeinsidenamespacercs1110.md new file mode 100644 index 0000000000..d2aac4e398 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/declaretypeinsidenamespacercs1110.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Declare type inside namespace" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declare type inside namespace + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareTypeInsideNamespaceRCS1110** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DeclareTypeInsideNamespaceRCS1110.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DeclareTypeInsideNamespaceRCS1110 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/defaultexpressionrcs1244.md b/docs/recipes/csharp/recipes/roslynator/analyzers/defaultexpressionrcs1244.md new file mode 100644 index 0000000000..f6520e6588 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/defaultexpressionrcs1244.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify 'default' expression" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify 'default' expression + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DefaultExpressionRCS1244** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DefaultExpressionRCS1244.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DefaultExpressionRCS1244 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/destructordeclarationrcs1106.md b/docs/recipes/csharp/recipes/roslynator/analyzers/destructordeclarationrcs1106.md new file mode 100644 index 0000000000..59cdfd017d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/destructordeclarationrcs1106.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty destructor" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty destructor + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DestructorDeclarationRCS1106** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DestructorDeclarationRCS1106.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DestructorDeclarationRCS1106 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/directivetriviarcs1222.md b/docs/recipes/csharp/recipes/roslynator/analyzers/directivetriviarcs1222.md new file mode 100644 index 0000000000..69263d8455 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/directivetriviarcs1222.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Merge preprocessor directives" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Merge preprocessor directives + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DirectiveTriviaRCS1222** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DirectiveTriviaRCS1222.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DirectiveTriviaRCS1222 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/disposeresourceasynchronouslyrcs1261.md b/docs/recipes/csharp/recipes/roslynator/analyzers/disposeresourceasynchronouslyrcs1261.md new file mode 100644 index 0000000000..e60bdb528f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/disposeresourceasynchronouslyrcs1261.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Resource can be disposed asynchronously" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Resource can be disposed asynchronously + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DisposeResourceAsynchronouslyRCS1261** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DisposeResourceAsynchronouslyRCS1261.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DisposeResourceAsynchronouslyRCS1261 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/documentationcommentrcs1139.md b/docs/recipes/csharp/recipes/roslynator/analyzers/documentationcommentrcs1139.md new file mode 100644 index 0000000000..005a323880 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/documentationcommentrcs1139.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add summary element to documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add summary element to documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DocumentationCommentRCS1139** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DocumentationCommentRCS1139.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DocumentationCommentRCS1139 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/documentrcs1093.md b/docs/recipes/csharp/recipes/roslynator/analyzers/documentrcs1093.md new file mode 100644 index 0000000000..fd76e1db6d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/documentrcs1093.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "File contains no code" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File contains no code + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DocumentRCS1093** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DocumentRCS1093.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DocumentRCS1093 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/dostatementrcs1063.md b/docs/recipes/csharp/recipes/roslynator/analyzers/dostatementrcs1063.md new file mode 100644 index 0000000000..a8c05f0783 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/dostatementrcs1063.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Avoid usage of do statement to create an infinite loop" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Avoid usage of do statement to create an infinite loop + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DoStatementRCS1063** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DoStatementRCS1063.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DoStatementRCS1063 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/duplicatewordincommentrcs1243.md b/docs/recipes/csharp/recipes/roslynator/analyzers/duplicatewordincommentrcs1243.md new file mode 100644 index 0000000000..bdfb931d15 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/duplicatewordincommentrcs1243.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Duplicate word in a comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Duplicate word in a comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.DuplicateWordInCommentRCS1243** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/DuplicateWordInCommentRCS1243.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DuplicateWordInCommentRCS1243 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/elseclausercs1006.md b/docs/recipes/csharp/recipes/roslynator/analyzers/elseclausercs1006.md new file mode 100644 index 0000000000..a9b489dc20 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/elseclausercs1006.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Merge 'else' with nested 'if'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Merge 'else' with nested 'if' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ElseClauseRCS1006** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ElseClauseRCS1006.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ElseClauseRCS1006 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/elseclausercs1040.md b/docs/recipes/csharp/recipes/roslynator/analyzers/elseclausercs1040.md new file mode 100644 index 0000000000..4765b2b840 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/elseclausercs1040.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty 'else' clause" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty 'else' clause + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ElseClauseRCS1040** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ElseClauseRCS1040.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ElseClauseRCS1040 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/emptystatementrcs1038.md b/docs/recipes/csharp/recipes/roslynator/analyzers/emptystatementrcs1038.md new file mode 100644 index 0000000000..ad1b877d29 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/emptystatementrcs1038.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty statement + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EmptyStatementRCS1038** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EmptyStatementRCS1038.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EmptyStatementRCS1038 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/endregiondirectivetriviarcs1189.md b/docs/recipes/csharp/recipes/roslynator/analyzers/endregiondirectivetriviarcs1189.md new file mode 100644 index 0000000000..424b09d2ac --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/endregiondirectivetriviarcs1189.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add or remove region name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add or remove region name + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EndRegionDirectiveTriviaRCS1189** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EndRegionDirectiveTriviaRCS1189.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EndRegionDirectiveTriviaRCS1189 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1154.md b/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1154.md new file mode 100644 index 0000000000..ea33abb6fd --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1154.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Sort enum members" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Sort enum members + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1154** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EnumDeclarationRCS1154.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumDeclarationRCS1154 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1161.md b/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1161.md new file mode 100644 index 0000000000..d03c28e688 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1161.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Enum should declare explicit values" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Enum should declare explicit values + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1161** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EnumDeclarationRCS1161.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumDeclarationRCS1161 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1237.md b/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1237.md new file mode 100644 index 0000000000..15a6072815 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/enumdeclarationrcs1237.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use bit shift operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use bit shift operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1237** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EnumDeclarationRCS1237.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumDeclarationRCS1237 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1191.md b/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1191.md new file mode 100644 index 0000000000..d49b270db3 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1191.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Declare enum value as combination of names" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declare enum value as combination of names + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1191** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EnumMemberDeclarationRCS1191.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumMemberDeclarationRCS1191 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1234.md b/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1234.md new file mode 100644 index 0000000000..6542e33e16 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1234.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Duplicate enum value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Duplicate enum value + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1234** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EnumMemberDeclarationRCS1234.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumMemberDeclarationRCS1234 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1254.md b/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1254.md new file mode 100644 index 0000000000..d1ad7fa8d7 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/enummemberdeclarationrcs1254.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Normalize format of enum flag value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Normalize format of enum flag value + +**org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1254** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/EnumMemberDeclarationRCS1254.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe EnumMemberDeclarationRCS1254 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/expressionrcs1051.md b/docs/recipes/csharp/recipes/roslynator/analyzers/expressionrcs1051.md new file mode 100644 index 0000000000..ab6bf4d70a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/expressionrcs1051.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add/remove parentheses from condition in conditional operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add/remove parentheses from condition in conditional operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ExpressionRCS1051** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ExpressionRCS1051.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ExpressionRCS1051 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/expressionrcs1215.md b/docs/recipes/csharp/recipes/roslynator/analyzers/expressionrcs1215.md new file mode 100644 index 0000000000..6bbde0fbc8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/expressionrcs1215.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Expression is always equal to true/false" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Expression is always equal to true/false + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ExpressionRCS1215** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ExpressionRCS1215.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ExpressionRCS1215 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/extractmembertonewdocumentrcs1060.md b/docs/recipes/csharp/recipes/roslynator/analyzers/extractmembertonewdocumentrcs1060.md new file mode 100644 index 0000000000..d76f9f879a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/extractmembertonewdocumentrcs1060.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Declare each type in separate file" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declare each type in separate file + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ExtractMemberToNewDocumentRCS1060** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ExtractMemberToNewDocumentRCS1060.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ExtractMemberToNewDocumentRCS1060 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/finallyclausercs1066.md b/docs/recipes/csharp/recipes/roslynator/analyzers/finallyclausercs1066.md new file mode 100644 index 0000000000..6706662c38 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/finallyclausercs1066.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty 'finally' clause" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty 'finally' clause + +**org.openrewrite.csharp.recipes.roslynator.analyzers.FinallyClauseRCS1066** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/FinallyClauseRCS1066.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe FinallyClauseRCS1066 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/forstatementrcs1064.md b/docs/recipes/csharp/recipes/roslynator/analyzers/forstatementrcs1064.md new file mode 100644 index 0000000000..7938b0124d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/forstatementrcs1064.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Avoid usage of for statement to create an infinite loop" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Avoid usage of for statement to create an infinite loop + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ForStatementRCS1064** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ForStatementRCS1064.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ForStatementRCS1064 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1061.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1061.md new file mode 100644 index 0000000000..b7a1d72c43 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1061.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Merge 'if' with nested 'if'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Merge 'if' with nested 'if' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1061** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1061.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1061 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1073.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1073.md new file mode 100644 index 0000000000..d11e46c8b0 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1073.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Convert 'if' to 'return' statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Convert 'if' to 'return' statement + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1073** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1073.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1073 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1103.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1103.md new file mode 100644 index 0000000000..9cd22acd5d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1103.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Convert 'if' to assignment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Convert 'if' to assignment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1103** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1103.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1103 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1173.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1173.md new file mode 100644 index 0000000000..782bcdbbbf --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1173.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use coalesce expression instead of 'if'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use coalesce expression instead of 'if' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1173** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1173.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1173 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1208.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1208.md new file mode 100644 index 0000000000..6c24fdb039 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1208.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Reduce 'if' nesting" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Reduce 'if' nesting + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1208** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1208.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1208 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1236.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1236.md new file mode 100644 index 0000000000..faafec0abc --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1236.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use exception filter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use exception filter + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1236** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1236.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1236 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1255.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1255.md new file mode 100644 index 0000000000..5f6220b941 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ifstatementrcs1255.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify argument null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify argument null check + +**org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1255** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/IfStatementRCS1255.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IfStatementRCS1255 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/implementnongenericcounterpartrcs1241.md b/docs/recipes/csharp/recipes/roslynator/analyzers/implementnongenericcounterpartrcs1241.md new file mode 100644 index 0000000000..deb5b7a9bd --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/implementnongenericcounterpartrcs1241.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Implement non-generic counterpart" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Implement non-generic counterpart + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ImplementNonGenericCounterpartRCS1241** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ImplementNonGenericCounterpartRCS1241.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ImplementNonGenericCounterpartRCS1241 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/initializerrcs1035.md b/docs/recipes/csharp/recipes/roslynator/analyzers/initializerrcs1035.md new file mode 100644 index 0000000000..4f65914a9b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/initializerrcs1035.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove redundant comma in initializer" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove redundant comma in initializer + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InitializerRCS1035** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InitializerRCS1035.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InitializerRCS1035 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/interpolatedstringrcs1214.md b/docs/recipes/csharp/recipes/roslynator/analyzers/interpolatedstringrcs1214.md new file mode 100644 index 0000000000..25a144ba61 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/interpolatedstringrcs1214.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary interpolated string" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary interpolated string + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolatedStringRCS1214** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InterpolatedStringRCS1214.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InterpolatedStringRCS1214 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/interpolatedstringrcs1217.md b/docs/recipes/csharp/recipes/roslynator/analyzers/interpolatedstringrcs1217.md new file mode 100644 index 0000000000..0395d138d0 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/interpolatedstringrcs1217.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Convert interpolated string to concatenation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Convert interpolated string to concatenation + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolatedStringRCS1217** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InterpolatedStringRCS1217.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InterpolatedStringRCS1217 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/interpolationrcs1105.md b/docs/recipes/csharp/recipes/roslynator/analyzers/interpolationrcs1105.md new file mode 100644 index 0000000000..19b5144b83 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/interpolationrcs1105.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary interpolation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary interpolation + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolationRCS1105** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InterpolationRCS1105.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InterpolationRCS1105 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invalidargumentnullcheckrcs1256.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invalidargumentnullcheckrcs1256.md new file mode 100644 index 0000000000..e082f0bdca --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invalidargumentnullcheckrcs1256.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Invalid argument null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Invalid argument null check + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvalidArgumentNullCheckRCS1256** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvalidArgumentNullCheckRCS1256.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvalidArgumentNullCheckRCS1256 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1080.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1080.md new file mode 100644 index 0000000000..cf59dc8f42 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1080.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'Count/Length' property instead of 'Any' method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'Count/Length' property instead of 'Any' method + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1080** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1080.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1080 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1097.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1097.md new file mode 100644 index 0000000000..2ae7096c9f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1097.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant 'ToString' call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant 'ToString' call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1097** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1097.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1097 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1107.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1107.md new file mode 100644 index 0000000000..1d38598863 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1107.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant 'ToCharArray' call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant 'ToCharArray' call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1107** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1107.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1107 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1112.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1112.md new file mode 100644 index 0000000000..f4ea6c37cd --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1112.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Combine 'Enumerable.Where' method chain" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Combine 'Enumerable.Where' method chain + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1112** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1112.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1112 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1196.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1196.md new file mode 100644 index 0000000000..4d8d729694 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1196.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Call extension method as instance method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Call extension method as instance method + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1196** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1196.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1196 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1200.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1200.md new file mode 100644 index 0000000000..24324ce09b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1200.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1200** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1200.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1200 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1267.md b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1267.md new file mode 100644 index 0000000000..9212cf1219 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/invocationexpressionrcs1267.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use string interpolation instead of 'string.Concat'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use string interpolation instead of 'string.Concat' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1267** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/InvocationExpressionRCS1267.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe InvocationExpressionRCS1267 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/localdeclarationstatementrcs1124.md b/docs/recipes/csharp/recipes/roslynator/analyzers/localdeclarationstatementrcs1124.md new file mode 100644 index 0000000000..2d88cdfbe9 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/localdeclarationstatementrcs1124.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Inline local variable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Inline local variable + +**org.openrewrite.csharp.recipes.roslynator.analyzers.LocalDeclarationStatementRCS1124** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/LocalDeclarationStatementRCS1124.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe LocalDeclarationStatementRCS1124 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/lockstatementrcs1059.md b/docs/recipes/csharp/recipes/roslynator/analyzers/lockstatementrcs1059.md new file mode 100644 index 0000000000..56eb4fc1aa --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/lockstatementrcs1059.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid locking on publicly accessible instance" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid locking on publicly accessible instance + +**org.openrewrite.csharp.recipes.roslynator.analyzers.LockStatementRCS1059** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/LockStatementRCS1059.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe LockStatementRCS1059 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/marklocalvariableasconstrcs1118.md b/docs/recipes/csharp/recipes/roslynator/analyzers/marklocalvariableasconstrcs1118.md new file mode 100644 index 0000000000..b589fc0fe6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/marklocalvariableasconstrcs1118.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Mark local variable as const" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark local variable as const + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MarkLocalVariableAsConstRCS1118** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MarkLocalVariableAsConstRCS1118.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MarkLocalVariableAsConstRCS1118 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/marktypewithdebuggerdisplayattributercs1223.md b/docs/recipes/csharp/recipes/roslynator/analyzers/marktypewithdebuggerdisplayattributercs1223.md new file mode 100644 index 0000000000..8338688003 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/marktypewithdebuggerdisplayattributercs1223.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Mark publicly visible type with DebuggerDisplay attribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Mark publicly visible type with DebuggerDisplay attribute + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MarkTypeWithDebuggerDisplayAttributeRCS1223** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MarkTypeWithDebuggerDisplayAttributeRCS1223.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MarkTypeWithDebuggerDisplayAttributeRCS1223 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1018.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1018.md new file mode 100644 index 0000000000..84a603dc19 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1018.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add/remove accessibility modifiers" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add/remove accessibility modifiers + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1018** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1018.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1018 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1019.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1019.md new file mode 100644 index 0000000000..895088c75a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1019.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Order modifiers" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Order modifiers + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1019** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1019.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1019 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1034.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1034.md new file mode 100644 index 0000000000..31bd1411c6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1034.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant 'sealed' modifier" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant 'sealed' modifier + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1034** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1034.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1034 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1055.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1055.md new file mode 100644 index 0000000000..c5dc3eb32e --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1055.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary semicolon at the end of declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary semicolon at the end of declaration + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1055** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1055.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1055 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1132.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1132.md new file mode 100644 index 0000000000..1c8dfc946f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1132.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant overriding member" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant overriding member + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1132** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1132.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1132 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1169.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1169.md new file mode 100644 index 0000000000..00dea8ac44 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1169.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make field read-only" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make field read-only + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1169** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1169.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1169 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1170.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1170.md new file mode 100644 index 0000000000..305ddd4116 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1170.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use read-only auto-implemented property" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use read-only auto-implemented property + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1170** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1170.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1170 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1181.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1181.md new file mode 100644 index 0000000000..0f4fa0b5e9 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1181.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Convert comment to documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Convert comment to documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1181** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1181.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1181 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1187.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1187.md new file mode 100644 index 0000000000..2379c2584f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1187.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use constant instead of field" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use constant instead of field + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1187** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1187.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1187 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1224.md b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1224.md new file mode 100644 index 0000000000..0060f94277 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/memberdeclarationrcs1224.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make method an extension method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make method an extension method + +**org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1224** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/MemberDeclarationRCS1224.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MemberDeclarationRCS1224 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/namespacedeclarationrcs1072.md b/docs/recipes/csharp/recipes/roslynator/analyzers/namespacedeclarationrcs1072.md new file mode 100644 index 0000000000..4f75431505 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/namespacedeclarationrcs1072.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty namespace declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty namespace declaration + +**org.openrewrite.csharp.recipes.roslynator.analyzers.NamespaceDeclarationRCS1072** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/NamespaceDeclarationRCS1072.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe NamespaceDeclarationRCS1072 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/namespacedeclarationrcs1094.md b/docs/recipes/csharp/recipes/roslynator/analyzers/namespacedeclarationrcs1094.md new file mode 100644 index 0000000000..9b17b78d32 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/namespacedeclarationrcs1094.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Declare using directive on top level" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declare using directive on top level + +**org.openrewrite.csharp.recipes.roslynator.analyzers.NamespaceDeclarationRCS1094** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/NamespaceDeclarationRCS1094.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe NamespaceDeclarationRCS1094 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/normalizenullcheckproviderrcs1248.md b/docs/recipes/csharp/recipes/roslynator/analyzers/normalizenullcheckproviderrcs1248.md new file mode 100644 index 0000000000..93e6253185 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/normalizenullcheckproviderrcs1248.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Normalize null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Normalize null check + +**org.openrewrite.csharp.recipes.roslynator.analyzers.NormalizeNullCheckProviderRCS1248** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/NormalizeNullCheckProviderRCS1248.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe NormalizeNullCheckProviderRCS1248 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/normalizeusageofinfinitelooprcs1252.md b/docs/recipes/csharp/recipes/roslynator/analyzers/normalizeusageofinfinitelooprcs1252.md new file mode 100644 index 0000000000..2c128fafc5 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/normalizeusageofinfinitelooprcs1252.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Normalize usage of infinite loop" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Normalize usage of infinite loop + +**org.openrewrite.csharp.recipes.roslynator.analyzers.NormalizeUsageOfInfiniteLoopRCS1252** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/NormalizeUsageOfInfiniteLoopRCS1252.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe NormalizeUsageOfInfiniteLoopRCS1252 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/objectcreationexpressionrcs1204.md b/docs/recipes/csharp/recipes/roslynator/analyzers/objectcreationexpressionrcs1204.md new file mode 100644 index 0000000000..68b32eb4c5 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/objectcreationexpressionrcs1204.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use EventArgs.Empty" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use EventArgs.Empty + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ObjectCreationExpressionRCS1204** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ObjectCreationExpressionRCS1204.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ObjectCreationExpressionRCS1204 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/optimizelinqmethodcallrcs1077.md b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizelinqmethodcallrcs1077.md new file mode 100644 index 0000000000..4240609fa0 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizelinqmethodcallrcs1077.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Optimize LINQ method call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Optimize LINQ method call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeLinqMethodCallRCS1077** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/OptimizeLinqMethodCallRCS1077.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqMethodCallRCS1077 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/optimizelinqmethodcallrcs1246.md b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizelinqmethodcallrcs1246.md new file mode 100644 index 0000000000..cd85104a4d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizelinqmethodcallrcs1246.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use element access" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use element access + +**org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeLinqMethodCallRCS1246** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/OptimizeLinqMethodCallRCS1246.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeLinqMethodCallRCS1246 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/optimizemethodcallrcs1235.md b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizemethodcallrcs1235.md new file mode 100644 index 0000000000..e9d748feb6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizemethodcallrcs1235.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Optimize method call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Optimize method call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeMethodCallRCS1235** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/OptimizeMethodCallRCS1235.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeMethodCallRCS1235 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/optimizestringbuilderappendcallrcs1197.md b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizestringbuilderappendcallrcs1197.md new file mode 100644 index 0000000000..52cc91c285 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/optimizestringbuilderappendcallrcs1197.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Optimize StringBuilder.Append/AppendLine call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Optimize StringBuilder.Append/AppendLine call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeStringBuilderAppendCallRCS1197** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/OptimizeStringBuilderAppendCallRCS1197.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OptimizeStringBuilderAppendCallRCS1197 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/orderelementsindocumentationcommentrcs1232.md b/docs/recipes/csharp/recipes/roslynator/analyzers/orderelementsindocumentationcommentrcs1232.md new file mode 100644 index 0000000000..1d1e258bc8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/orderelementsindocumentationcommentrcs1232.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Order elements in documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Order elements in documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.OrderElementsInDocumentationCommentRCS1232** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/OrderElementsInDocumentationCommentRCS1232.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OrderElementsInDocumentationCommentRCS1232 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/ordertypeparameterconstraintsrcs1209.md b/docs/recipes/csharp/recipes/roslynator/analyzers/ordertypeparameterconstraintsrcs1209.md new file mode 100644 index 0000000000..d8febbc25a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/ordertypeparameterconstraintsrcs1209.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Order type parameter constraints" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Order type parameter constraints + +**org.openrewrite.csharp.recipes.roslynator.analyzers.OrderTypeParameterConstraintsRCS1209** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/OrderTypeParameterConstraintsRCS1209.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe OrderTypeParameterConstraintsRCS1209 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/parameternamediffersfrombasercs1168.md b/docs/recipes/csharp/recipes/roslynator/analyzers/parameternamediffersfrombasercs1168.md new file mode 100644 index 0000000000..38b09e659e --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/parameternamediffersfrombasercs1168.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Parameter name differs from base name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Parameter name differs from base name + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterNameDiffersFromBaseRCS1168** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ParameterNameDiffersFromBaseRCS1168.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterNameDiffersFromBaseRCS1168 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1193.md b/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1193.md new file mode 100644 index 0000000000..8b5503b699 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1193.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Overriding member should not change 'params' modifier" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Overriding member should not change 'params' modifier + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1193** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ParameterRCS1193.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterRCS1193 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1231.md b/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1231.md new file mode 100644 index 0000000000..e5cfd3e0f8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1231.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Make parameter ref read-only" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Make parameter ref read-only + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1231** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ParameterRCS1231.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterRCS1231 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1242.md b/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1242.md new file mode 100644 index 0000000000..8cd0a9ebfc --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/parameterrcs1242.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Do not pass non-read-only struct by read-only reference" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not pass non-read-only struct by read-only reference + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1242** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ParameterRCS1242.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParameterRCS1242 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/parenthesizedexpressionrcs1032.md b/docs/recipes/csharp/recipes/roslynator/analyzers/parenthesizedexpressionrcs1032.md new file mode 100644 index 0000000000..fd19492298 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/parenthesizedexpressionrcs1032.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant parentheses" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant parentheses + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ParenthesizedExpressionRCS1032** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ParenthesizedExpressionRCS1032.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ParenthesizedExpressionRCS1032 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/propertydeclarationrcs1188.md b/docs/recipes/csharp/recipes/roslynator/analyzers/propertydeclarationrcs1188.md new file mode 100644 index 0000000000..7f44b6166e --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/propertydeclarationrcs1188.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant auto-property initialization" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant auto-property initialization + +**org.openrewrite.csharp.recipes.roslynator.analyzers.PropertyDeclarationRCS1188** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/PropertyDeclarationRCS1188.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PropertyDeclarationRCS1188 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/rawstringliteralrcs1262.md b/docs/recipes/csharp/recipes/roslynator/analyzers/rawstringliteralrcs1262.md new file mode 100644 index 0000000000..e8d4c04d85 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/rawstringliteralrcs1262.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary raw string literal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary raw string literal + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RawStringLiteralRCS1262** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RawStringLiteralRCS1262.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RawStringLiteralRCS1262 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/rawstringliteralrcs1266.md b/docs/recipes/csharp/recipes/roslynator/analyzers/rawstringliteralrcs1266.md new file mode 100644 index 0000000000..a20e496052 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/rawstringliteralrcs1266.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use raw string literal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use raw string literal + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RawStringLiteralRCS1266** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RawStringLiteralRCS1266.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RawStringLiteralRCS1266 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/regiondirectivetriviarcs1091.md b/docs/recipes/csharp/recipes/roslynator/analyzers/regiondirectivetriviarcs1091.md new file mode 100644 index 0000000000..2cbc542fbc --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/regiondirectivetriviarcs1091.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty region" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty region + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RegionDirectiveTriviaRCS1091** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RegionDirectiveTriviaRCS1091.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RegionDirectiveTriviaRCS1091 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removebracesfromifelsercs1004.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removebracesfromifelsercs1004.md new file mode 100644 index 0000000000..17c98ae2d6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removebracesfromifelsercs1004.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove braces from if-else" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove braces from if-else + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveBracesFromIfElseRCS1004** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveBracesFromIfElseRCS1004.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveBracesFromIfElseRCS1004 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removebracesrcs1002.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removebracesrcs1002.md new file mode 100644 index 0000000000..1a92160f67 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removebracesrcs1002.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove braces" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove braces + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveBracesRCS1002** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveBracesRCS1002.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveBracesRCS1002 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeelementindocumentationcommentrcs1228.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeelementindocumentationcommentrcs1228.md new file mode 100644 index 0000000000..095f4b3eaa --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeelementindocumentationcommentrcs1228.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unused element in a documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unused element in a documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveElementInDocumentationCommentRCS1228** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveElementInDocumentationCommentRCS1228.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveElementInDocumentationCommentRCS1228 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeelementindocumentationcommentrcs1263.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeelementindocumentationcommentrcs1263.md new file mode 100644 index 0000000000..bf61caaf6c --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeelementindocumentationcommentrcs1263.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Invalid reference in a documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Invalid reference in a documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveElementInDocumentationCommentRCS1263** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveElementInDocumentationCommentRCS1263.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveElementInDocumentationCommentRCS1263 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeemptyinitializerrcs1041.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeemptyinitializerrcs1041.md new file mode 100644 index 0000000000..42b9f241ec --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeemptyinitializerrcs1041.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove empty initializer" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove empty initializer + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEmptyInitializerRCS1041** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveEmptyInitializerRCS1041.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveEmptyInitializerRCS1041 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeemptysyntaxrcs1259.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeemptysyntaxrcs1259.md new file mode 100644 index 0000000000..b5fbae2dcd --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeemptysyntaxrcs1259.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove empty syntax" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove empty syntax + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEmptySyntaxRCS1259** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveEmptySyntaxRCS1259.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveEmptySyntaxRCS1259 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeenumdefaultbasetypercs1042.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeenumdefaultbasetypercs1042.md new file mode 100644 index 0000000000..40f8af0d8a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeenumdefaultbasetypercs1042.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove enum default underlying type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove enum default underlying type + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEnumDefaultBaseTypeRCS1042** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveEnumDefaultBaseTypeRCS1042.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveEnumDefaultBaseTypeRCS1042 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeoriginalexceptionrcs1044.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeoriginalexceptionrcs1044.md new file mode 100644 index 0000000000..63d597125f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeoriginalexceptionrcs1044.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove original exception from throw statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove original exception from throw statement + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveOriginalExceptionRCS1044** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveOriginalExceptionRCS1044.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveOriginalExceptionRCS1044 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removepartialmodifierfromtypewithsinglepartrcs1043.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removepartialmodifierfromtypewithsinglepartrcs1043.md new file mode 100644 index 0000000000..0db377f59c --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removepartialmodifierfromtypewithsinglepartrcs1043.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove 'partial' modifier from type with a single part" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove 'partial' modifier from type with a single part + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemovePartialModifierFromTypeWithSinglePartRCS1043** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemovePartialModifierFromTypeWithSinglePartRCS1043.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemovePartialModifierFromTypeWithSinglePartRCS1043 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantassignmentrcs1212.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantassignmentrcs1212.md new file mode 100644 index 0000000000..b53373a029 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantassignmentrcs1212.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant assignment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant assignment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantAssignmentRCS1212** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveRedundantAssignmentRCS1212.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRedundantAssignmentRCS1212 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantasyncawaitrcs1174.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantasyncawaitrcs1174.md new file mode 100644 index 0000000000..ac297e1f09 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantasyncawaitrcs1174.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant async/await" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant async/await + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantAsyncAwaitRCS1174** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveRedundantAsyncAwaitRCS1174.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRedundantAsyncAwaitRCS1174 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantbooleanliteralrcs1033.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantbooleanliteralrcs1033.md new file mode 100644 index 0000000000..162af63808 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantbooleanliteralrcs1033.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant boolean literal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant boolean literal + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantBooleanLiteralRCS1033** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveRedundantBooleanLiteralRCS1033.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRedundantBooleanLiteralRCS1033 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantcastrcs1151.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantcastrcs1151.md new file mode 100644 index 0000000000..4e91e3f683 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantcastrcs1151.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant cast" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant cast + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantCastRCS1151** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveRedundantCastRCS1151.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRedundantCastRCS1151 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantcatchblockrcs1265.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantcatchblockrcs1265.md new file mode 100644 index 0000000000..5cd4553299 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeredundantcatchblockrcs1265.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant catch block" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant catch block + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantCatchBlockRCS1265** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveRedundantCatchBlockRCS1265.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRedundantCatchBlockRCS1265 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeunnecessarybracesrcs1251.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeunnecessarybracesrcs1251.md new file mode 100644 index 0000000000..6d10d774ad --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeunnecessarybracesrcs1251.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove unnecessary braces from record declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove unnecessary braces from record declaration + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveUnnecessaryBracesRCS1251** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveUnnecessaryBracesRCS1251.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveUnnecessaryBracesRCS1251 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/removeunnecessaryelsercs1211.md b/docs/recipes/csharp/recipes/roslynator/analyzers/removeunnecessaryelsercs1211.md new file mode 100644 index 0000000000..a224dfa0b1 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/removeunnecessaryelsercs1211.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove unnecessary 'else'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove unnecessary 'else' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveUnnecessaryElseRCS1211** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/RemoveUnnecessaryElseRCS1211.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveUnnecessaryElseRCS1211 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/returncompletedtaskinsteadofnullrcs1210.md b/docs/recipes/csharp/recipes/roslynator/analyzers/returncompletedtaskinsteadofnullrcs1210.md new file mode 100644 index 0000000000..6214a6e471 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/returncompletedtaskinsteadofnullrcs1210.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Return completed task instead of returning null" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Return completed task instead of returning null + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ReturnCompletedTaskInsteadOfNullRCS1210** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ReturnCompletedTaskInsteadOfNullRCS1210.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ReturnCompletedTaskInsteadOfNullRCS1210 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/simplifybooleancomparisonrcs1049.md b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifybooleancomparisonrcs1049.md new file mode 100644 index 0000000000..534fc4d497 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifybooleancomparisonrcs1049.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify boolean comparison" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify boolean comparison + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyBooleanComparisonRCS1049** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SimplifyBooleanComparisonRCS1049.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SimplifyBooleanComparisonRCS1049 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/simplifycodebranchingrcs1218.md b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifycodebranchingrcs1218.md new file mode 100644 index 0000000000..8c5a707b6d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifycodebranchingrcs1218.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify code branching" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify code branching + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyCodeBranchingRCS1218** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SimplifyCodeBranchingRCS1218.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SimplifyCodeBranchingRCS1218 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/simplifylogicalnegationrcs1068.md b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifylogicalnegationrcs1068.md new file mode 100644 index 0000000000..4e96cb8dd0 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifylogicalnegationrcs1068.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify logical negation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify logical negation + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyLogicalNegationRCS1068** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SimplifyLogicalNegationRCS1068.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SimplifyLogicalNegationRCS1068 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/simplifynestedusingstatementrcs1005.md b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifynestedusingstatementrcs1005.md new file mode 100644 index 0000000000..4a5e020318 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifynestedusingstatementrcs1005.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify nested using statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify nested using statement + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyNestedUsingStatementRCS1005** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SimplifyNestedUsingStatementRCS1005.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SimplifyNestedUsingStatementRCS1005 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/simplifynullableoftrcs1020.md b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifynullableoftrcs1020.md new file mode 100644 index 0000000000..12c6bb331a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/simplifynullableoftrcs1020.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Simplify Nullable to T?" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Simplify Nullable<T> to T? + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyNullableOfTRCS1020** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SimplifyNullableOfTRCS1020.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SimplifyNullableOfTRCS1020 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1100.md b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1100.md new file mode 100644 index 0000000000..04395b7b84 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1100.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Format documentation summary on a single line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Format documentation summary on a single line + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1100** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SingleLineDocumentationCommentTriviaRCS1100.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SingleLineDocumentationCommentTriviaRCS1100 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1101.md b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1101.md new file mode 100644 index 0000000000..127c782ac8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1101.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Format documentation summary on multiple lines" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Format documentation summary on multiple lines + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1101** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SingleLineDocumentationCommentTriviaRCS1101.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SingleLineDocumentationCommentTriviaRCS1101 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1141.md b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1141.md new file mode 100644 index 0000000000..db956f3076 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1141.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add 'param' element to documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add 'param' element to documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1141** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SingleLineDocumentationCommentTriviaRCS1141.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SingleLineDocumentationCommentTriviaRCS1141 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1142.md b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1142.md new file mode 100644 index 0000000000..4817c0793e --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1142.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add 'typeparam' element to documentation comment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add 'typeparam' element to documentation comment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1142** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SingleLineDocumentationCommentTriviaRCS1142.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SingleLineDocumentationCommentTriviaRCS1142 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1253.md b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1253.md new file mode 100644 index 0000000000..72a752d799 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/singlelinedocumentationcommenttriviarcs1253.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Format documentation comment summary" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Format documentation comment summary + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1253** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SingleLineDocumentationCommentTriviaRCS1253.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SingleLineDocumentationCommentTriviaRCS1253 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1133.md b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1133.md new file mode 100644 index 0000000000..a1cf425efc --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1133.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant Dispose/Close call" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant Dispose/Close call + +**org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1133** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/StatementRCS1133.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe StatementRCS1133 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1134.md b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1134.md new file mode 100644 index 0000000000..c1e6258ce6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1134.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant statement + +**org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1134** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/StatementRCS1134.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe StatementRCS1134 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1180.md b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1180.md new file mode 100644 index 0000000000..d723ef1b54 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1180.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Inline lazy initialization" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Inline lazy initialization + +**org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1180** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/StatementRCS1180.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe StatementRCS1180 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1201.md b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1201.md new file mode 100644 index 0000000000..98be42a6c6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/statementrcs1201.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use method chaining" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use method chaining + +**org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1201** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/StatementRCS1201.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe StatementRCS1201 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1070.md b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1070.md new file mode 100644 index 0000000000..0e174d491d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1070.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant default switch section" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant default switch section + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1070** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SwitchSectionRCS1070.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SwitchSectionRCS1070 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1099.md b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1099.md new file mode 100644 index 0000000000..08e75cb6cc --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1099.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Default label should be the last label in a switch section" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Default label should be the last label in a switch section + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1099** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SwitchSectionRCS1099.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SwitchSectionRCS1099 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1111.md b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1111.md new file mode 100644 index 0000000000..7a751c9f01 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1111.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Add braces to switch section with multiple statements" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add braces to switch section with multiple statements + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1111** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SwitchSectionRCS1111.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SwitchSectionRCS1111 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1136.md b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1136.md new file mode 100644 index 0000000000..ec6252f5d8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/switchsectionrcs1136.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Merge switch sections with equivalent content" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Merge switch sections with equivalent content + +**org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1136** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/SwitchSectionRCS1136.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SwitchSectionRCS1136 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/tokenrcs1249.md b/docs/recipes/csharp/recipes/roslynator/analyzers/tokenrcs1249.md new file mode 100644 index 0000000000..dfa821a76b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/tokenrcs1249.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary null-forgiving operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary null-forgiving operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.TokenRCS1249** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/TokenRCS1249.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenRCS1249 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/typeparameterrcs1164.md b/docs/recipes/csharp/recipes/roslynator/analyzers/typeparameterrcs1164.md new file mode 100644 index 0000000000..dcd9529421 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/typeparameterrcs1164.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unused type parameter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unused type parameter + +**org.openrewrite.csharp.recipes.roslynator.analyzers.TypeParameterRCS1164** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/TypeParameterRCS1164.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TypeParameterRCS1164 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/typercs1159.md b/docs/recipes/csharp/recipes/roslynator/analyzers/typercs1159.md new file mode 100644 index 0000000000..31699a17aa --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/typercs1159.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use EventHandler" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use EventHandler<T> + +**org.openrewrite.csharp.recipes.roslynator.analyzers.TypeRCS1159** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/TypeRCS1159.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TypeRCS1159 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryassignmentrcs1179.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryassignmentrcs1179.md new file mode 100644 index 0000000000..a4be18d20b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryassignmentrcs1179.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary assignment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary assignment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryAssignmentRCS1179** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnnecessaryAssignmentRCS1179.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnnecessaryAssignmentRCS1179 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryenumflagrcs1258.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryenumflagrcs1258.md new file mode 100644 index 0000000000..640b8ba898 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryenumflagrcs1258.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary enum flag" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary enum flag + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryEnumFlagRCS1258** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnnecessaryEnumFlagRCS1258.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnnecessaryEnumFlagRCS1258 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryexplicituseofenumeratorrcs1230.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryexplicituseofenumeratorrcs1230.md new file mode 100644 index 0000000000..045eec8e3f --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryexplicituseofenumeratorrcs1230.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary explicit use of enumerator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary explicit use of enumerator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryExplicitUseOfEnumeratorRCS1230** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnnecessaryExplicitUseOfEnumeratorRCS1230.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnnecessaryExplicitUseOfEnumeratorRCS1230 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryunsafecontextrcs1216.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryunsafecontextrcs1216.md new file mode 100644 index 0000000000..b02e2a89c5 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryunsafecontextrcs1216.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary unsafe context" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary unsafe context + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryUnsafeContextRCS1216** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnnecessaryUnsafeContextRCS1216.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnnecessaryUnsafeContextRCS1216 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryusageofverbatimstringliteralrcs1192.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryusageofverbatimstringliteralrcs1192.md new file mode 100644 index 0000000000..6c9a7bb828 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unnecessaryusageofverbatimstringliteralrcs1192.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unnecessary usage of verbatim string literal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unnecessary usage of verbatim string literal + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryUsageOfVerbatimStringLiteralRCS1192** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnnecessaryUsageOfVerbatimStringLiteralRCS1192.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnnecessaryUsageOfVerbatimStringLiteralRCS1192 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unusedmemberrcs1213.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unusedmemberrcs1213.md new file mode 100644 index 0000000000..ef901b51b3 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unusedmemberrcs1213.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove unused member declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove unused member declaration + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnusedMemberRCS1213** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnusedMemberRCS1213.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnusedMemberRCS1213 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/unusedparameterrcs1163.md b/docs/recipes/csharp/recipes/roslynator/analyzers/unusedparameterrcs1163.md new file mode 100644 index 0000000000..b463ed87fc --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/unusedparameterrcs1163.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Unused parameter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Unused parameter + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UnusedParameterRCS1163** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UnusedParameterRCS1163.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UnusedParameterRCS1163 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useanonymousfunctionormethodgrouprcs1207.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useanonymousfunctionormethodgrouprcs1207.md new file mode 100644 index 0000000000..d44af73b63 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useanonymousfunctionormethodgrouprcs1207.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use anonymous function or method group" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use anonymous function or method group + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseAnonymousFunctionOrMethodGroupRCS1207** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseAnonymousFunctionOrMethodGroupRCS1207.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseAnonymousFunctionOrMethodGroupRCS1207 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useasyncawaitrcs1229.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useasyncawaitrcs1229.md new file mode 100644 index 0000000000..b6a195b6f6 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useasyncawaitrcs1229.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use async/await when necessary" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use async/await when necessary + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseAsyncAwaitRCS1229** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseAsyncAwaitRCS1229.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseAsyncAwaitRCS1229 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useautopropertyrcs1085.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useautopropertyrcs1085.md new file mode 100644 index 0000000000..0c0b9fc81a --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useautopropertyrcs1085.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use auto-implemented property" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use auto-implemented property + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseAutoPropertyRCS1085** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseAutoPropertyRCS1085.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseAutoPropertyRCS1085 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useblockbodyorexpressionbodyrcs1016.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useblockbodyorexpressionbodyrcs1016.md new file mode 100644 index 0000000000..5a89b1aa24 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useblockbodyorexpressionbodyrcs1016.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use block body or expression body" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use block body or expression body + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseBlockBodyOrExpressionBodyRCS1016** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseBlockBodyOrExpressionBodyRCS1016.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseBlockBodyOrExpressionBodyRCS1016 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usecoalesceexpressionrcs1128.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usecoalesceexpressionrcs1128.md new file mode 100644 index 0000000000..e5a9e00c13 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usecoalesceexpressionrcs1128.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use coalesce expression" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use coalesce expression + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseCoalesceExpressionRCS1128** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseCoalesceExpressionRCS1128.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseCoalesceExpressionRCS1128 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usecompoundassignmentrcs1058.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usecompoundassignmentrcs1058.md new file mode 100644 index 0000000000..edb4a6a9e7 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usecompoundassignmentrcs1058.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use compound assignment" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use compound assignment + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseCompoundAssignmentRCS1058** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseCompoundAssignmentRCS1058.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseCompoundAssignmentRCS1058 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useconditionalaccessrcs1146.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useconditionalaccessrcs1146.md new file mode 100644 index 0000000000..6277f29e99 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useconditionalaccessrcs1146.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use conditional access" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use conditional access + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseConditionalAccessRCS1146** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseConditionalAccessRCS1146.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseConditionalAccessRCS1146 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useemptystringliteralorstringemptyrcs1078.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useemptystringliteralorstringemptyrcs1078.md new file mode 100644 index 0000000000..163f8ceafe --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useemptystringliteralorstringemptyrcs1078.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use \"\" or 'string.Empty'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use "" or 'string.Empty' + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseEmptyStringLiteralOrStringEmptyRCS1078** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseEmptyStringLiteralOrStringEmptyRCS1078.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseEmptyStringLiteralOrStringEmptyRCS1078 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicitlyorimplicitlytypedarrayrcs1014.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicitlyorimplicitlytypedarrayrcs1014.md new file mode 100644 index 0000000000..1d0cb146e1 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicitlyorimplicitlytypedarrayrcs1014.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use explicitly/implicitly typed array" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use explicitly/implicitly typed array + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitlyOrImplicitlyTypedArrayRCS1014** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseExplicitlyOrImplicitlyTypedArrayRCS1014.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExplicitlyOrImplicitlyTypedArrayRCS1014 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarinforeachrcs1009.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarinforeachrcs1009.md new file mode 100644 index 0000000000..1a66c3ab5c --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarinforeachrcs1009.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use explicit type instead of 'var' (foreach variable)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use explicit type instead of 'var' (foreach variable) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarInForEachRCS1009** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseExplicitTypeInsteadOfVarInForEachRCS1009.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExplicitTypeInsteadOfVarInForEachRCS1009 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarrcs1008.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarrcs1008.md new file mode 100644 index 0000000000..715be38053 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarrcs1008.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use explicit type instead of 'var' (when the type is not obvious)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use explicit type instead of 'var' (when the type is not obvious) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarRCS1008** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseExplicitTypeInsteadOfVarRCS1008.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExplicitTypeInsteadOfVarRCS1008 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarrcs1012.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarrcs1012.md new file mode 100644 index 0000000000..8eb2b1c997 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useexplicittypeinsteadofvarrcs1012.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use explicit type instead of 'var' (when the type is obvious)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use explicit type instead of 'var' (when the type is obvious) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarRCS1012** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseExplicitTypeInsteadOfVarRCS1012.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseExplicitTypeInsteadOfVarRCS1012 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usehasflagmethodorbitwiseoperatorrcs1096.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usehasflagmethodorbitwiseoperatorrcs1096.md new file mode 100644 index 0000000000..49c6bceb3b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usehasflagmethodorbitwiseoperatorrcs1096.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'HasFlag' method or bitwise operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'HasFlag' method or bitwise operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseHasFlagMethodOrBitwiseOperatorRCS1096** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseHasFlagMethodOrBitwiseOperatorRCS1096.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseHasFlagMethodOrBitwiseOperatorRCS1096 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useimplicitorexplicitobjectcreationrcs1250.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useimplicitorexplicitobjectcreationrcs1250.md new file mode 100644 index 0000000000..3d0a665940 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useimplicitorexplicitobjectcreationrcs1250.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use implicit/explicit object creation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use implicit/explicit object creation + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseImplicitOrExplicitObjectCreationRCS1250** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseImplicitOrExplicitObjectCreationRCS1250.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseImplicitOrExplicitObjectCreationRCS1250 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useisoperatorinsteadofasoperatorrcs1172.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useisoperatorinsteadofasoperatorrcs1172.md new file mode 100644 index 0000000000..35ff5de3d8 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useisoperatorinsteadofasoperatorrcs1172.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'is' operator instead of 'as' operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'is' operator instead of 'as' operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseIsOperatorInsteadOfAsOperatorRCS1172** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseIsOperatorInsteadOfAsOperatorRCS1172.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseIsOperatorInsteadOfAsOperatorRCS1172 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usenameofoperatorrcs1015.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usenameofoperatorrcs1015.md new file mode 100644 index 0000000000..1ccd1f4802 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usenameofoperatorrcs1015.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use nameof operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use nameof operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseNameOfOperatorRCS1015** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseNameOfOperatorRCS1015.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseNameOfOperatorRCS1015 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usepatternmatchinginsteadofasandnullcheckrcs1221.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usepatternmatchinginsteadofasandnullcheckrcs1221.md new file mode 100644 index 0000000000..fba1a89f49 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usepatternmatchinginsteadofasandnullcheckrcs1221.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use pattern matching instead of combination of 'as' operator and null check" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use pattern matching instead of combination of 'as' operator and null check + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UsePatternMatchingInsteadOfAsAndNullCheckRCS1221** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UsePatternMatchingInsteadOfAsAndNullCheckRCS1221.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePatternMatchingInsteadOfAsAndNullCheckRCS1221 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usepatternmatchinginsteadofisandcastrcs1220.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usepatternmatchinginsteadofisandcastrcs1220.md new file mode 100644 index 0000000000..27ab6fc60d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usepatternmatchinginsteadofisandcastrcs1220.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use pattern matching instead of combination of 'is' operator and cast operator" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use pattern matching instead of combination of 'is' operator and cast operator + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UsePatternMatchingInsteadOfIsAndCastRCS1220** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UsePatternMatchingInsteadOfIsAndCastRCS1220.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePatternMatchingInsteadOfIsAndCastRCS1220 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usepredefinedtypercs1013.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usepredefinedtypercs1013.md new file mode 100644 index 0000000000..8c04707bde --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usepredefinedtypercs1013.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use predefined type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use predefined type + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UsePredefinedTypeRCS1013** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UsePredefinedTypeRCS1013.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsePredefinedTypeRCS1013 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/useregexinstanceinsteadofstaticmethodrcs1186.md b/docs/recipes/csharp/recipes/roslynator/analyzers/useregexinstanceinsteadofstaticmethodrcs1186.md new file mode 100644 index 0000000000..247d7479ca --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/useregexinstanceinsteadofstaticmethodrcs1186.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use Regex instance instead of static method" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use Regex instance instead of static method + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseRegexInstanceInsteadOfStaticMethodRCS1186** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseRegexInstanceInsteadOfStaticMethodRCS1186.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseRegexInstanceInsteadOfStaticMethodRCS1186 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usestringcomparisonrcs1155.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usestringcomparisonrcs1155.md new file mode 100644 index 0000000000..a701fb3c43 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usestringcomparisonrcs1155.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use StringComparison when comparing strings" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use StringComparison when comparing strings + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseStringComparisonRCS1155** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseStringComparisonRCS1155.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseStringComparisonRCS1155 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1010.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1010.md new file mode 100644 index 0000000000..8c2c2642f4 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1010.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use 'var' instead of explicit type (when the type is obvious)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use 'var' instead of explicit type (when the type is obvious) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1010** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseVarInsteadOfExplicitTypeRCS1010.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseVarInsteadOfExplicitTypeRCS1010 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1176.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1176.md new file mode 100644 index 0000000000..c960ad7944 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1176.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use 'var' instead of explicit type (when the type is not obvious)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use 'var' instead of explicit type (when the type is not obvious) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1176** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseVarInsteadOfExplicitTypeRCS1176.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseVarInsteadOfExplicitTypeRCS1176 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1177.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1177.md new file mode 100644 index 0000000000..3e3c43a822 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarinsteadofexplicittypercs1177.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Use 'var' instead of explicit type (in foreach)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Use 'var' instead of explicit type (in foreach) + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1177** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseVarInsteadOfExplicitTypeRCS1177.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseVarInsteadOfExplicitTypeRCS1177 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usevarorexplicittypercs1264.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarorexplicittypercs1264.md new file mode 100644 index 0000000000..0dd2260092 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usevarorexplicittypercs1264.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'var' or explicit type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'var' or explicit type + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarOrExplicitTypeRCS1264** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UseVarOrExplicitTypeRCS1264.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseVarOrExplicitTypeRCS1264 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/usingdirectivercs1056.md b/docs/recipes/csharp/recipes/roslynator/analyzers/usingdirectivercs1056.md new file mode 100644 index 0000000000..6327c189e7 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/usingdirectivercs1056.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Avoid usage of using alias directive" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Avoid usage of using alias directive + +**org.openrewrite.csharp.recipes.roslynator.analyzers.UsingDirectiveRCS1056** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/UsingDirectiveRCS1056.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingDirectiveRCS1056 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/validateargumentscorrectlyrcs1227.md b/docs/recipes/csharp/recipes/roslynator/analyzers/validateargumentscorrectlyrcs1227.md new file mode 100644 index 0000000000..ddd581c39e --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/validateargumentscorrectlyrcs1227.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Validate arguments correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Validate arguments correctly + +**org.openrewrite.csharp.recipes.roslynator.analyzers.ValidateArgumentsCorrectlyRCS1227** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/ValidateArgumentsCorrectlyRCS1227.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ValidateArgumentsCorrectlyRCS1227 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/variabledeclarationrcs1081.md b/docs/recipes/csharp/recipes/roslynator/analyzers/variabledeclarationrcs1081.md new file mode 100644 index 0000000000..ea0780c148 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/variabledeclarationrcs1081.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Split variable declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Split variable declaration + +**org.openrewrite.csharp.recipes.roslynator.analyzers.VariableDeclarationRCS1081** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/VariableDeclarationRCS1081.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe VariableDeclarationRCS1081 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/variabledeclaratorrcs1129.md b/docs/recipes/csharp/recipes/roslynator/analyzers/variabledeclaratorrcs1129.md new file mode 100644 index 0000000000..222f206b4d --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/variabledeclaratorrcs1129.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove redundant field initialization" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove redundant field initialization + +**org.openrewrite.csharp.recipes.roslynator.analyzers.VariableDeclaratorRCS1129** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/VariableDeclaratorRCS1129.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe VariableDeclaratorRCS1129 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/whilestatementrcs1065.md b/docs/recipes/csharp/recipes/roslynator/analyzers/whilestatementrcs1065.md new file mode 100644 index 0000000000..306fe640f2 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/whilestatementrcs1065.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Avoid usage of while statement to create an infinite loop" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Avoid usage of while statement to create an infinite loop + +**org.openrewrite.csharp.recipes.roslynator.analyzers.WhileStatementRCS1065** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/WhileStatementRCS1065.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe WhileStatementRCS1065 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/whilestatementrcs1239.md b/docs/recipes/csharp/recipes/roslynator/analyzers/whilestatementrcs1239.md new file mode 100644 index 0000000000..7ea7225cf2 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/whilestatementrcs1239.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Use 'for' statement instead of 'while' statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use 'for' statement instead of 'while' statement + +**org.openrewrite.csharp.recipes.roslynator.analyzers.WhileStatementRCS1239** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/WhileStatementRCS1239.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe WhileStatementRCS1239 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/whitespacetriviarcs1036.md b/docs/recipes/csharp/recipes/roslynator/analyzers/whitespacetriviarcs1036.md new file mode 100644 index 0000000000..eba774e50b --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/whitespacetriviarcs1036.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "[deprecated] Remove unnecessary blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [deprecated] Remove unnecessary blank line + +**org.openrewrite.csharp.recipes.roslynator.analyzers.WhitespaceTriviaRCS1036** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/WhitespaceTriviaRCS1036.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe WhitespaceTriviaRCS1036 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/whitespacetriviarcs1037.md b/docs/recipes/csharp/recipes/roslynator/analyzers/whitespacetriviarcs1037.md new file mode 100644 index 0000000000..745df17ac5 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/whitespacetriviarcs1037.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Remove trailing white-space" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove trailing white-space + +**org.openrewrite.csharp.recipes.roslynator.analyzers.WhitespaceTriviaRCS1037** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/WhitespaceTriviaRCS1037.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe WhitespaceTriviaRCS1037 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/roslynator/analyzers/xmlnodercs1247.md b/docs/recipes/csharp/recipes/roslynator/analyzers/xmlnodercs1247.md new file mode 100644 index 0000000000..db109df068 --- /dev/null +++ b/docs/recipes/csharp/recipes/roslynator/analyzers/xmlnodercs1247.md @@ -0,0 +1,109 @@ +--- +sidebar_label: "Fix documentation comment tag" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Fix documentation comment tag + +**org.openrewrite.csharp.recipes.roslynator.analyzers.XmlNodeRCS1247** + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/roslynator/analyzers/XmlNodeRCS1247.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe XmlNodeRCS1247 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/README.md b/docs/recipes/csharp/recipes/stylecop/README.md new file mode 100644 index 0000000000..962ba5434e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/README.md @@ -0,0 +1,7 @@ +# Stylecop + +## Categories + +* [Analyzers](/recipes/csharp/recipes/stylecop/analyzers) + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/README.md b/docs/recipes/csharp/recipes/stylecop/analyzers/README.md new file mode 100644 index 0000000000..199d9ac033 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/README.md @@ -0,0 +1,150 @@ +# Analyzers + +## Recipes + +* [Access modifier should be declared](./sa1400sa1400.md) +* [Accessible fields should begin with upper-case letter](./renametouppercasesa1307.md) +* [All accessors should be single-line or multi-line](./sa1504sa1504.md) +* [Arithmetic expressions should declare precedence](./sa1407sa1408sa1407.md) +* [Attribute constructor should not use unnecessary parenthesis](./sa1410sa1411sa1411.md) +* [Attributes should not share line](./sa1134sa1134.md) +* [Braces for multi-line statements should not share line](./sa1500sa1500.md) +* [Braces should not be omitted](./sa1503sa1503.md) +* [Braces should not be omitted from multi-line child statement](./sa1503sa1519.md) +* [Chained statement blocks should not be preceded by blank line](./sa1510sa1510.md) +* [Closing attribute brackets should be spaced correctly](./tokenspacingsa1017.md) +* [Closing brace should be followed by blank line](./sa1513sa1513.md) +* [Closing braces should be spaced correctly](./tokenspacingsa1013.md) +* [Closing braces should not be preceded by blank line](./sa1508sa1508.md) +* [Closing generic brackets should be spaced correctly](./tokenspacingsa1015.md) +* [Closing parenthesis should be on line of last parameter](./tokenspacingsa1111.md) +* [Closing parenthesis should be on line of opening parenthesis](./tokenspacingsa1112.md) +* [Closing parenthesis should be spaced correctly](./tokenspacingsa1009.md) +* [Closing square brackets should be spaced correctly](./tokenspacingsa1011.md) +* [Code analysis suppression should have justification](./sa1404sa1404.md) +* [Code should not contain blank lines at start of file](./sa1517sa1517.md) +* [Code should not contain empty statements](./sa1106sa1106.md) +* [Code should not contain multiple blank lines in a row](./sa1507sa1507.md) +* [Code should not contain multiple statements on one line](./sa1107sa1107.md) +* [Code should not contain multiple whitespace in a row](./sa1025sa1025.md) +* [Code should not contain space after new or stackalloc keyword in implicitly typed array allocation](./tokenspacingsa1026.md) +* [Code should not contain trailing whitespace](./sa1028sa1028.md) +* [Colons Should Be Spaced Correctly](./tokenspacingsa1024.md) +* [Comma should be on the same line as previous parameter](./tokenspacingsa1113.md) +* [Commas should be spaced correctly](./tokenspacingsa1001.md) +* [Comments should contain text](./sa1120sa1120.md) +* [Conditional expressions should declare precedence](./sa1407sa1408sa1408.md) +* [Const field names should begin with upper-case letter](./renametouppercasesa1303.md) +* [Constructor summary documentation should begin with standard text](./sa1642sa1643sa1642.md) +* [Declaration keywords should follow order](./sa1206sa1206.md) +* [Dereference and access of symbols should be spaced correctly](./tokenspacingsa1023.md) +* [Destructor summary documentation should begin with standard text](./sa1642sa1643sa1643.md) +* [Do not combine attributes](./sa1133sa1133.md) +* [Do not combine fields](./sa1132sa1132.md) +* [Do not place regions within elements](./removeregionsa1123.md) +* [Do not prefix calls with base unless local implementation exists](./sa1100sa1100.md) +* [Do not prefix local calls with 'this.'](./sx1101sx1101.md) +* [Do not use default value type constructor](./sa1129sa1129.md) +* [Do not use placeholder elements](./sa1651sa1651.md) +* [Do not use regions](./removeregionsa1124.md) +* [Documentation lines should begin with single space](./sa1004sa1004.md) +* [Documentation text should end with a period](./sa1629sa1629.md) +* [Element documentation header should be preceded by blank line](./sa1514sa1514.md) +* [Element documentation headers should not be followed by blank line](./sa1506sa1506.md) +* [Element return value documentation should have text](./sa1615sa1616sa1616.md) +* [Element return value should be documented](./sa1615sa1616sa1615.md) +* [Element should begin with upper-case letter](./renametouppercasesa1300.md) +* [Element should not be on a single line](./sa1502sa1502.md) +* [Elements should be documented](./settingsfilesa1600.md) +* [Elements should be separated by blank line](./sa1516sa1516.md) +* [Elements should have the same indentation](./indentationsa1137.md) +* [Enum values should be on separate lines](./sa1136sa1136.md) +* [Enumeration items should be documented](./settingsfilesa1602.md) +* [Event accessors should follow order](./sa1212sa1213sa1213.md) +* [Field names should begin with lower-case letter](./renametolowercasesa1306.md) +* [Field names should begin with underscore](./sx1309sx1309.md) +* [Field names should not begin with underscore](./sa1309sa1309.md) +* [Field names should not contain underscore](./sa1310sa1310.md) +* [File header company name text should match](./settingsfilesa1641.md) +* [File header copyright text should match](./settingsfilesa1636.md) +* [File header file name documentation should match file name](./settingsfilesa1638.md) +* [File header should contain file name](./settingsfilesa1637.md) +* [File header should have copyright text](./settingsfilesa1635.md) +* [File header should have summary](./settingsfilesa1639.md) +* [File header should have valid company text](./settingsfilesa1640.md) +* [File header should show copyright](./settingsfilesa1634.md) +* [File may only contain a single type](./sa1402sa1402.md) +* [File name should match first type name](./settingsfilesa1649.md) +* [File should have header](./settingsfilesa1633.md) +* [Generic type constraints should be on their own line](./sa1127sa1127.md) +* [Increment decrement symbols should be spaced correctly](./tokenspacingsa1020.md) +* [Interface names should begin with I](./sa1302sa1302.md) +* [Keywords should be spaced correctly](./tokenspacingsa1000.md) +* [Member access symbols should be spaced correctly](./tokenspacingsa1019.md) +* [Negative signs should be spaced correctly](./tokenspacingsa1021.md) +* [Non-private readonly fields should begin with upper-case letter](./renametouppercasesa1304.md) +* [Nullable type symbols should be spaced correctly](./sa1018sa1018.md) +* [Opening attribute brackets should be spaced correctly](./tokenspacingsa1016.md) +* [Opening braces should be spaced correctly](./tokenspacingsa1012.md) +* [Opening braces should not be followed by blank line](./sa1505sa1505.md) +* [Opening braces should not be preceded by blank line](./sa1509sa1509.md) +* [Opening generic brackets should be spaced correctly](./tokenspacingsa1014.md) +* [Opening parenthesis or bracket should be on declaration line](./tokenspacingsa1110.md) +* [Opening parenthesis should be spaced correctly](./tokenspacingsa1008.md) +* [Opening square brackets should be spaced correctly](./tokenspacingsa1010.md) +* [Operator keyword should be followed by space](./tokenspacingsa1007.md) +* [Parameter names should begin with lower-case letter](./renametolowercasesa1313.md) +* [Partial elements should be documented](./settingsfilesa1601.md) +* [Partial elements should declare access](./sa1205sa1205.md) +* [Positive signs should be spaced correctly](./tokenspacingsa1022.md) +* [Prefix local calls with this](./sa1101sa1101.md) +* [Preprocessor keywords should not be preceded by space](./tokenspacingsa1006.md) +* [Property accessors should follow order](./sa1212sa1213sa1212.md) +* [Property documentation should have value](./sa1609sa1610sa1609.md) +* [Property documentation should have value text](./sa1609sa1610sa1610.md) +* [Property summary documentation should match accessors](./propertysummarydocumentationsa1623.md) +* [Property summary documentation should omit accessor with restricted access](./propertysummarydocumentationsa1624.md) +* [Protected should come before internal](./sa1207sa1207.md) +* [Put constructor initializers on their own line](./sa1128sa1128.md) +* [Query clause should begin on new line when previous clause spans multiple lines](./sa1104sa1105sa1104.md) +* [Query clause should follow previous clause](./sa1102sa1102.md) +* [Query clauses should be on separate lines or all on one line](./sa1103sa1103.md) +* [Query clauses spanning multiple lines should begin on own line](./sa1104sa1105sa1105.md) +* [Remove delegate parenthesis when possible](./sa1410sa1411sa1410.md) +* [Semicolons should be spaced correctly](./tokenspacingsa1002.md) +* [Single line comments should begin with single space](./sa1005sa1005.md) +* [Single-line comment should be preceded by blank line](./sa1515sa1515.md) +* [Single-line comments should not be followed by blank line](./sa1512sa1512.md) +* [Single-line comments should not use documentation style slashes](./sa1626sa1626.md) +* [Split parameters should start on line after declaration](./sa1116sa1116.md) +* [Statement should not be on a single line](./sa1501sa1501.md) +* [Statement should not use unnecessary parenthesis](./sa1119sa1119.md) +* [Statement should not use unnecessary parenthesis](./sa1119sa1119_p.md) +* [Static field names should begin with underscore](./sx1309sx1309s.md) +* [Static readonly fields should begin with upper-case letter](./renametouppercasesa1311.md) +* [Store files as UTF-8 with byte order mark](./sa1412sa1412.md) +* [Symbols should be spaced correctly](./sa1003sa1003.md) +* [System using directives should be placed before other using directives](./usingsa1208.md) +* [Type parameter names should begin with T](./sa1314sa1314.md) +* [Use braces consistently](./sa1503sa1520.md) +* [Use built-in type alias](./sa1121sa1121.md) +* [Use lambda syntax](./sa1130sa1130.md) +* [Use line endings correctly at end of file](./sa1518sa1518.md) +* [Use literal suffix notation instead of casting](./sa1139sa1139.md) +* [Use readable conditions](./sa1131sa1131.md) +* [Use string.Empty for empty strings](./sa1122sa1122.md) +* [Use tabs correctly](./sa1027sa1027.md) +* [Use trailing comma in multi-line initializers](./sa1413sa1413.md) +* [Using alias directives should be ordered alphabetically by alias name](./usingsa1211.md) +* [Using alias directives should be placed after other using directives](./usingsa1209.md) +* [Using directives should be ordered alphabetically by namespace](./usingsa1210.md) +* [Using directives should be placed correctly](./usingsa1200.md) +* [Using directives should be qualified](./sa1135sa1135.md) +* [Using static directives should be ordered alphabetically](./usingsa1217.md) +* [Using static directives should be placed at the correct location.](./usingsa1216.md) +* [Variable names should begin with lower-case letter](./renametolowercasesa1312.md) +* [Variable names should not be prefixed](./sa1308sa1308.md) +* [Void return value should not be documented](./sa1617sa1617.md) +* [While-do footer should not be preceded by blank line](./sa1511sa1511.md) + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/indentationsa1137.md b/docs/recipes/csharp/recipes/stylecop/analyzers/indentationsa1137.md new file mode 100644 index 0000000000..7b3978d366 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/indentationsa1137.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Elements should have the same indentation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Elements should have the same indentation + +**org.openrewrite.csharp.recipes.stylecop.analyzers.IndentationSA1137** + +_Elements at the same level in the syntax tree should have the same indentation._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/IndentationSA1137.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe IndentationSA1137 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/propertysummarydocumentationsa1623.md b/docs/recipes/csharp/recipes/stylecop/analyzers/propertysummarydocumentationsa1623.md new file mode 100644 index 0000000000..5e9ede20f0 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/propertysummarydocumentationsa1623.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Property summary documentation should match accessors" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Property summary documentation should match accessors + +**org.openrewrite.csharp.recipes.stylecop.analyzers.PropertySummaryDocumentationSA1623** + +``` +The documentation text within a C# property’s tag does not match the accessors within the property. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/PropertySummaryDocumentationSA1623.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PropertySummaryDocumentationSA1623 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/propertysummarydocumentationsa1624.md b/docs/recipes/csharp/recipes/stylecop/analyzers/propertysummarydocumentationsa1624.md new file mode 100644 index 0000000000..f97fec5e23 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/propertysummarydocumentationsa1624.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Property summary documentation should omit accessor with restricted access" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Property summary documentation should omit accessor with restricted access + +**org.openrewrite.csharp.recipes.stylecop.analyzers.PropertySummaryDocumentationSA1624** + +``` +The documentation text within a C# property’s tag takes into account all of the accessors within the property, but one of the accessors has limited access. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/PropertySummaryDocumentationSA1624.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe PropertySummaryDocumentationSA1624 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/removeregionsa1123.md b/docs/recipes/csharp/recipes/stylecop/analyzers/removeregionsa1123.md new file mode 100644 index 0000000000..d003638944 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/removeregionsa1123.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not place regions within elements" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not place regions within elements + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RemoveRegionSA1123** + +_The C# code contains a region within the body of a code element._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RemoveRegionSA1123.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRegionSA1123 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/removeregionsa1124.md b/docs/recipes/csharp/recipes/stylecop/analyzers/removeregionsa1124.md new file mode 100644 index 0000000000..5eca28782d --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/removeregionsa1124.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use regions" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use regions + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RemoveRegionSA1124** + +_The C# code contains a region._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RemoveRegionSA1124.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RemoveRegionSA1124 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1306.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1306.md new file mode 100644 index 0000000000..0341cc534e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1306.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Field names should begin with lower-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Field names should begin with lower-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1306** + +_The name of a field in C# does not begin with a lower-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToLowerCaseSA1306.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToLowerCaseSA1306 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1312.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1312.md new file mode 100644 index 0000000000..5387d4c49d --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1312.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Variable names should begin with lower-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Variable names should begin with lower-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1312** + +_The name of a variable in C# does not begin with a lower-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToLowerCaseSA1312.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToLowerCaseSA1312 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1313.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1313.md new file mode 100644 index 0000000000..31127bd0c4 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametolowercasesa1313.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Parameter names should begin with lower-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Parameter names should begin with lower-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1313** + +_The name of a parameter in C# does not begin with a lower-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToLowerCaseSA1313.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToLowerCaseSA1313 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1300.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1300.md new file mode 100644 index 0000000000..80720d18f1 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1300.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Element should begin with upper-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Element should begin with upper-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1300** + +_The name of a C# element does not begin with an upper-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToUpperCaseSA1300.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToUpperCaseSA1300 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1303.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1303.md new file mode 100644 index 0000000000..d4c99454f3 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1303.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Const field names should begin with upper-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Const field names should begin with upper-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1303** + +_The name of a constant C# field should begin with an upper-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToUpperCaseSA1303.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToUpperCaseSA1303 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1304.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1304.md new file mode 100644 index 0000000000..361833c53e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1304.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Non-private readonly fields should begin with upper-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Non-private readonly fields should begin with upper-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1304** + +_The name of a non-private readonly C# field should being with an upper-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToUpperCaseSA1304.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToUpperCaseSA1304 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1307.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1307.md new file mode 100644 index 0000000000..8fb653ebab --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1307.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Accessible fields should begin with upper-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Accessible fields should begin with upper-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1307** + +_The name of a public or internal field in C# does not begin with an upper-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToUpperCaseSA1307.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToUpperCaseSA1307 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1311.md b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1311.md new file mode 100644 index 0000000000..4031a45e06 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/renametouppercasesa1311.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Static readonly fields should begin with upper-case letter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Static readonly fields should begin with upper-case letter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1311** + +_The name of a static readonly field does not begin with an upper-case letter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/RenameToUpperCaseSA1311.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameToUpperCaseSA1311 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1003sa1003.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1003sa1003.md new file mode 100644 index 0000000000..1422451ed4 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1003sa1003.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Symbols should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Symbols should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1003SA1003** + +_The spacing around an operator symbol is incorrect, within a C# code file._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1003SA1003.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1003SA1003 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1004sa1004.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1004sa1004.md new file mode 100644 index 0000000000..dfa4f60fc8 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1004sa1004.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Documentation lines should begin with single space" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Documentation lines should begin with single space + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1004SA1004** + +_A line within a documentation header above a C# element does not begin with a single space._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1004SA1004.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1004SA1004 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1005sa1005.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1005sa1005.md new file mode 100644 index 0000000000..cc4efe85ba --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1005sa1005.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Single line comments should begin with single space" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Single line comments should begin with single space + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1005SA1005** + +_A single-line comment within a C# code file does not begin with a single space._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1005SA1005.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1005SA1005 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1018sa1018.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1018sa1018.md new file mode 100644 index 0000000000..f81cd1c2de --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1018sa1018.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Nullable type symbols should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Nullable type symbols should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1018SA1018** + +_A nullable type symbol within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1018SA1018.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1018SA1018 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1025sa1025.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1025sa1025.md new file mode 100644 index 0000000000..8021ec5c01 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1025sa1025.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain multiple whitespace in a row" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain multiple whitespace in a row + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1025SA1025** + +_The code contains multiple whitespace characters in a row._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1025SA1025.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1025SA1025 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1027sa1027.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1027sa1027.md new file mode 100644 index 0000000000..2b063bb46a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1027sa1027.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use tabs correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use tabs correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1027SA1027** + +_The code contains a tab or space character which is not consistent with the current project settings._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1027SA1027.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1027SA1027 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1028sa1028.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1028sa1028.md new file mode 100644 index 0000000000..1a4f296eb5 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1028sa1028.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain trailing whitespace" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain trailing whitespace + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1028SA1028** + +_There should not be any whitespace at the end of a line of code._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1028SA1028.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1028SA1028 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1100sa1100.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1100sa1100.md new file mode 100644 index 0000000000..0c2113f4a5 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1100sa1100.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not prefix calls with base unless local implementation exists" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not prefix calls with base unless local implementation exists + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1100SA1100** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1100SA1100.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1100SA1100 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1101sa1101.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1101sa1101.md new file mode 100644 index 0000000000..117aaebba0 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1101sa1101.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Prefix local calls with this" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Prefix local calls with this + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1101SA1101** + +_A call to an instance member of the local class or a base class is not prefixed with 'this.', within a C# code file._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1101SA1101.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1101SA1101 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1102sa1102.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1102sa1102.md new file mode 100644 index 0000000000..b431d30681 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1102sa1102.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Query clause should follow previous clause" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Query clause should follow previous clause + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1102SA1102** + +_A C# query clause does not begin on the same line as the previous clause, or on the next line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1102SA1102.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1102SA1102 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1103sa1103.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1103sa1103.md new file mode 100644 index 0000000000..76bd5a31f0 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1103sa1103.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Query clauses should be on separate lines or all on one line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Query clauses should be on separate lines or all on one line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1103SA1103** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1103SA1103.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1103SA1103 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1104sa1105sa1104.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1104sa1105sa1104.md new file mode 100644 index 0000000000..4db414a302 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1104sa1105sa1104.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Query clause should begin on new line when previous clause spans multiple lines" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Query clause should begin on new line when previous clause spans multiple lines + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1104SA1105SA1104** + +_A clause within a C# query expression begins on the same line as the previous clause, when the previous clause spans across multiple lines._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1104SA1105SA1104.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1104SA1105SA1104 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1104sa1105sa1105.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1104sa1105sa1105.md new file mode 100644 index 0000000000..11203b29d5 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1104sa1105sa1105.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Query clauses spanning multiple lines should begin on own line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Query clauses spanning multiple lines should begin on own line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1104SA1105SA1105** + +_A clause within a C# query expression spans across multiple lines, and does not begin on its own line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1104SA1105SA1105.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1104SA1105SA1105 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1106sa1106.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1106sa1106.md new file mode 100644 index 0000000000..9cd624c0f6 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1106sa1106.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain empty statements" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain empty statements + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1106SA1106** + +_The C# code contains an extra semicolon._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1106SA1106.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1106SA1106 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1107sa1107.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1107sa1107.md new file mode 100644 index 0000000000..291607bc76 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1107sa1107.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain multiple statements on one line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain multiple statements on one line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1107SA1107** + +_The C# code contains more than one statement on a single line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1107SA1107.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1107SA1107 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1116sa1116.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1116sa1116.md new file mode 100644 index 0000000000..f9c4754b81 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1116sa1116.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Split parameters should start on line after declaration" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Split parameters should start on line after declaration + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1116SA1116** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1116SA1116.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1116SA1116 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1119sa1119.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1119sa1119.md new file mode 100644 index 0000000000..01ee083f66 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1119sa1119.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Statement should not use unnecessary parenthesis" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Statement should not use unnecessary parenthesis + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1119SA1119** + +_A C# statement contains parenthesis which are unnecessary and should be removed._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1119SA1119.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1119SA1119 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1119sa1119_p.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1119sa1119_p.md new file mode 100644 index 0000000000..4fa1f7ba97 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1119sa1119_p.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Statement should not use unnecessary parenthesis" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Statement should not use unnecessary parenthesis + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1119SA1119\_p** + +_A C# statement contains parenthesis which are unnecessary and should be removed._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1119SA1119_p.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1119SA1119_p +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1120sa1120.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1120sa1120.md new file mode 100644 index 0000000000..0d4b13059e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1120sa1120.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Comments should contain text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Comments should contain text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1120SA1120** + +_The C# comment does not contain any comment text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1120SA1120.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1120SA1120 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1121sa1121.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1121sa1121.md new file mode 100644 index 0000000000..ef736bdf7d --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1121sa1121.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use built-in type alias" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use built-in type alias + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1121SA1121** + +_The code uses one of the basic C# types, but does not use the built-in alias for the type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1121SA1121.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1121SA1121 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1122sa1122.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1122sa1122.md new file mode 100644 index 0000000000..b8bc77b38b --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1122sa1122.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use string.Empty for empty strings" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use string.Empty for empty strings + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1122SA1122** + +_The C# code includes an empty string, written as ""._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1122SA1122.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1122SA1122 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1127sa1127.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1127sa1127.md new file mode 100644 index 0000000000..8e179412c5 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1127sa1127.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Generic type constraints should be on their own line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Generic type constraints should be on their own line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1127SA1127** + +_Each type constraint clause for a generic type parameter should be listed on a line of code by itself._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1127SA1127.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1127SA1127 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1128sa1128.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1128sa1128.md new file mode 100644 index 0000000000..fdaf7f2cdc --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1128sa1128.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Put constructor initializers on their own line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Put constructor initializers on their own line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1128SA1128** + +_A constructor initializer, including the colon character, should be on its own line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1128SA1128.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1128SA1128 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1129sa1129.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1129sa1129.md new file mode 100644 index 0000000000..c2ce90374a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1129sa1129.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not use default value type constructor" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use default value type constructor + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1129SA1129** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1129SA1129.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1129SA1129 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1130sa1130.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1130sa1130.md new file mode 100644 index 0000000000..eff1fe16c6 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1130sa1130.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use lambda syntax" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use lambda syntax + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1130SA1130** + +_Lambda expressions are more succinct and easier to read than anonymous methods, so they should are preferred whenever the two are functionally equivalent._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1130SA1130.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1130SA1130 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1131sa1131.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1131sa1131.md new file mode 100644 index 0000000000..90e97ecaf3 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1131sa1131.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use readable conditions" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use readable conditions + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1131SA1131** + +_When a comparison is made between a variable and a literal, the variable should be placed on the left-hand-side to maximize readability._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1131SA1131.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1131SA1131 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1132sa1132.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1132sa1132.md new file mode 100644 index 0000000000..90e561b4f2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1132sa1132.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not combine fields" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not combine fields + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1132SA1132** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1132SA1132.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1132SA1132 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1133sa1133.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1133sa1133.md new file mode 100644 index 0000000000..681e8c9b75 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1133sa1133.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not combine attributes" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not combine attributes + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1133SA1133** + +_Each attribute usage should be placed in its own set of square brackets for maximum readability._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1133SA1133.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1133SA1133 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1134sa1134.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1134sa1134.md new file mode 100644 index 0000000000..2b20724337 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1134sa1134.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Attributes should not share line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Attributes should not share line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1134SA1134** + +_Each attribute should be placed on its own line of code._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1134SA1134.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1134SA1134 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1135sa1135.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1135sa1135.md new file mode 100644 index 0000000000..b59b2380c8 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1135sa1135.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using directives should be qualified" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using directives should be qualified + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1135SA1135** + +_All using directives should be qualified._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1135SA1135.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1135SA1135 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1136sa1136.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1136sa1136.md new file mode 100644 index 0000000000..5db404d5fd --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1136sa1136.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Enum values should be on separate lines" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Enum values should be on separate lines + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1136SA1136** + +_Enum values should be placed on their own lines for maximum readability._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1136SA1136.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1136SA1136 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1139sa1139.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1139sa1139.md new file mode 100644 index 0000000000..eb569f5f67 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1139sa1139.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use literal suffix notation instead of casting" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use literal suffix notation instead of casting + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1139SA1139** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1139SA1139.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1139SA1139 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1205sa1205.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1205sa1205.md new file mode 100644 index 0000000000..7d5e399900 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1205sa1205.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Partial elements should declare access" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Partial elements should declare access + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1205SA1205** + +_The partial element does not have an access modifier defined._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1205SA1205.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1205SA1205 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1206sa1206.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1206sa1206.md new file mode 100644 index 0000000000..30c4476f2b --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1206sa1206.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Declaration keywords should follow order" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Declaration keywords should follow order + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1206SA1206** + +_The keywords within the declaration of an element do not follow a standard ordering scheme._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1206SA1206.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1206SA1206 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1207sa1207.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1207sa1207.md new file mode 100644 index 0000000000..16b112e869 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1207sa1207.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Protected should come before internal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Protected should come before internal + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1207SA1207** + +``` +The keyword '{0}' is positioned after the keyword '{1}' within the declaration of a {0} {1} C# element. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1207SA1207.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1207SA1207 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1212sa1213sa1212.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1212sa1213sa1212.md new file mode 100644 index 0000000000..e4b9718e35 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1212sa1213sa1212.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Property accessors should follow order" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Property accessors should follow order + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1212SA1213SA1212** + +_A get accessor appears after a set accessor within a property or indexer._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1212SA1213SA1212.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1212SA1213SA1212 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1212sa1213sa1213.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1212sa1213sa1213.md new file mode 100644 index 0000000000..daf7256ca2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1212sa1213sa1213.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Event accessors should follow order" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Event accessors should follow order + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1212SA1213SA1213** + +_An add accessor appears after a remove accessor within an event._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1212SA1213SA1213.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1212SA1213SA1213 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1302sa1302.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1302sa1302.md new file mode 100644 index 0000000000..5d356e56bd --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1302sa1302.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Interface names should begin with I" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Interface names should begin with I + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1302SA1302** + +_The name of a C# interface does not begin with the capital letter I._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1302SA1302.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1302SA1302 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1308sa1308.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1308sa1308.md new file mode 100644 index 0000000000..0724d73957 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1308sa1308.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Variable names should not be prefixed" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Variable names should not be prefixed + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1308SA1308** + +_A field name in C# is prefixed with 'm_', 's_', or 't_'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1308SA1308.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1308SA1308 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1309sa1309.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1309sa1309.md new file mode 100644 index 0000000000..eed536ce82 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1309sa1309.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Field names should not begin with underscore" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Field names should not begin with underscore + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1309SA1309** + +_A field name in C# begins with an underscore._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1309SA1309.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1309SA1309 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1310sa1310.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1310sa1310.md new file mode 100644 index 0000000000..5cf62d5fd4 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1310sa1310.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Field names should not contain underscore" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Field names should not contain underscore + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1310SA1310** + +_A field name in C# contains an underscore._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1310SA1310.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1310SA1310 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1314sa1314.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1314sa1314.md new file mode 100644 index 0000000000..3aed2ddb57 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1314sa1314.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Type parameter names should begin with T" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Type parameter names should begin with T + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1314SA1314** + +_The name of a C# type parameter does not begin with the capital letter T._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1314SA1314.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1314SA1314 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1400sa1400.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1400sa1400.md new file mode 100644 index 0000000000..2e9976febc --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1400sa1400.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Access modifier should be declared" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Access modifier should be declared + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1400SA1400** + +_The access modifier for a C# element has not been explicitly defined._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1400SA1400.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1400SA1400 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1402sa1402.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1402sa1402.md new file mode 100644 index 0000000000..3678a6890c --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1402sa1402.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File may only contain a single type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File may only contain a single type + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1402SA1402** + +_A C# code file contains more than one unique type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1402SA1402.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1402SA1402 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1404sa1404.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1404sa1404.md new file mode 100644 index 0000000000..33703c05bb --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1404sa1404.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code analysis suppression should have justification" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code analysis suppression should have justification + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1404SA1404** + +_A Code Analysis SuppressMessage attribute does not include a justification._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1404SA1404.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1404SA1404 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1407sa1408sa1407.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1407sa1408sa1407.md new file mode 100644 index 0000000000..92b62536c1 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1407sa1408sa1407.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Arithmetic expressions should declare precedence" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Arithmetic expressions should declare precedence + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1407SA1408SA1407** + +_A C# statement contains a complex arithmetic expression which omits parenthesis around operators._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1407SA1408SA1407.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1407SA1408SA1407 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1407sa1408sa1408.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1407sa1408sa1408.md new file mode 100644 index 0000000000..43a0a475f2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1407sa1408sa1408.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Conditional expressions should declare precedence" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Conditional expressions should declare precedence + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1407SA1408SA1408** + +_A C# statement contains a complex conditional expression which omits parenthesis around operators._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1407SA1408SA1408.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1407SA1408SA1408 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1410sa1411sa1410.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1410sa1411sa1410.md new file mode 100644 index 0000000000..0701d9ae35 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1410sa1411sa1410.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Remove delegate parenthesis when possible" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Remove delegate parenthesis when possible + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1410SA1411SA1410** + +_A call to a C# anonymous method does not contain any method parameters, yet the statement still includes parenthesis._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1410SA1411SA1410.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1410SA1411SA1410 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1410sa1411sa1411.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1410sa1411sa1411.md new file mode 100644 index 0000000000..210b191fe4 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1410sa1411sa1411.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Attribute constructor should not use unnecessary parenthesis" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Attribute constructor should not use unnecessary parenthesis + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1410SA1411SA1411** + +_TODO._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1410SA1411SA1411.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1410SA1411SA1411 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1412sa1412.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1412sa1412.md new file mode 100644 index 0000000000..1d61da13eb --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1412sa1412.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Store files as UTF-8 with byte order mark" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Store files as UTF-8 with byte order mark + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1412SA1412** + +_Source files should be saved using the UTF-8 encoding with a byte order mark_ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1412SA1412.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1412SA1412 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1413sa1413.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1413sa1413.md new file mode 100644 index 0000000000..ebb7e84a60 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1413sa1413.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use trailing comma in multi-line initializers" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use trailing comma in multi-line initializers + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1413SA1413** + +_A multi-line initializer in a C# code file should use a comma on the last line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1413SA1413.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1413SA1413 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1500sa1500.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1500sa1500.md new file mode 100644 index 0000000000..d53b7bbd48 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1500sa1500.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Braces for multi-line statements should not share line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Braces for multi-line statements should not share line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1500SA1500** + +_The opening or closing brace within a C# statement, element, or expression is not placed on its own line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1500SA1500.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1500SA1500 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1501sa1501.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1501sa1501.md new file mode 100644 index 0000000000..9fc5f49dab --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1501sa1501.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Statement should not be on a single line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Statement should not be on a single line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1501SA1501** + +_A C# statement containing opening and closing braces is written completely on a single line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1501SA1501.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1501SA1501 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1502sa1502.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1502sa1502.md new file mode 100644 index 0000000000..745a22651e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1502sa1502.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Element should not be on a single line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Element should not be on a single line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1502SA1502** + +_A C# element containing opening and closing braces is written completely on a single line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1502SA1502.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1502SA1502 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1503.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1503.md new file mode 100644 index 0000000000..ace24ff8eb --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1503.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Braces should not be omitted" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Braces should not be omitted + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1503** + +_The opening and closing braces for a C# statement have been omitted._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1503SA1503.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1503SA1503 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1519.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1519.md new file mode 100644 index 0000000000..9c2ae9f23f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1519.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Braces should not be omitted from multi-line child statement" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Braces should not be omitted from multi-line child statement + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1519** + +_The opening and closing braces for a multi-line C# statement have been omitted._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1503SA1519.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1503SA1519 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1520.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1520.md new file mode 100644 index 0000000000..985722fd2a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1503sa1520.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use braces consistently" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use braces consistently + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1520** + +_The opening and closing braces of a chained if/else if/else construct were included for some clauses, but omitted for others._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1503SA1520.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1503SA1520 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1504sa1504.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1504sa1504.md new file mode 100644 index 0000000000..01c81c2e56 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1504sa1504.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "All accessors should be single-line or multi-line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# All accessors should be single-line or multi-line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1504SA1504** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1504SA1504.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1504SA1504 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1505sa1505.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1505sa1505.md new file mode 100644 index 0000000000..cbf80c0262 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1505sa1505.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening braces should not be followed by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening braces should not be followed by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1505SA1505** + +_An opening brace within a C# element, statement, or expression is followed by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1505SA1505.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1505SA1505 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1506sa1506.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1506sa1506.md new file mode 100644 index 0000000000..4b3873bf4f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1506sa1506.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Element documentation headers should not be followed by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Element documentation headers should not be followed by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1506SA1506** + +_An element documentation header above a C# element is followed by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1506SA1506.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1506SA1506 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1507sa1507.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1507sa1507.md new file mode 100644 index 0000000000..5e40065256 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1507sa1507.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain multiple blank lines in a row" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain multiple blank lines in a row + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1507SA1507** + +_The C# code contains multiple blank lines in a row._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1507SA1507.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1507SA1507 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1508sa1508.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1508sa1508.md new file mode 100644 index 0000000000..0b6c679748 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1508sa1508.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing braces should not be preceded by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing braces should not be preceded by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1508SA1508** + +_A closing brace within a C# element, statement, or expression is preceded by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1508SA1508.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1508SA1508 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1509sa1509.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1509sa1509.md new file mode 100644 index 0000000000..1cecdaac37 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1509sa1509.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening braces should not be preceded by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening braces should not be preceded by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1509SA1509** + +_An opening brace within a C# element, statement, or expression is preceded by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1509SA1509.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1509SA1509 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1510sa1510.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1510sa1510.md new file mode 100644 index 0000000000..2a73b25d67 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1510sa1510.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Chained statement blocks should not be preceded by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Chained statement blocks should not be preceded by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1510SA1510** + +_Chained C# statements are separated by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1510SA1510.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1510SA1510 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1511sa1511.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1511sa1511.md new file mode 100644 index 0000000000..ec5bb18bb0 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1511sa1511.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "While-do footer should not be preceded by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# While-do footer should not be preceded by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1511SA1511** + +_The while footer at the bottom of a do-while statement is separated from the statement by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1511SA1511.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1511SA1511 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1512sa1512.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1512sa1512.md new file mode 100644 index 0000000000..2d45f4d6d6 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1512sa1512.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Single-line comments should not be followed by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Single-line comments should not be followed by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1512SA1512** + +_A single-line comment within C# code is followed by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1512SA1512.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1512SA1512 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1513sa1513.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1513sa1513.md new file mode 100644 index 0000000000..c635d33e1e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1513sa1513.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing brace should be followed by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing brace should be followed by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1513SA1513** + +_A closing brace within a C# element, statement, or expression is not followed by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1513SA1513.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1513SA1513 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1514sa1514.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1514sa1514.md new file mode 100644 index 0000000000..bdabbaa6d2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1514sa1514.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Element documentation header should be preceded by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Element documentation header should be preceded by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1514SA1514** + +_An element documentation header above a C# element is not preceded by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1514SA1514.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1514SA1514 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1515sa1515.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1515sa1515.md new file mode 100644 index 0000000000..720b822def --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1515sa1515.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Single-line comment should be preceded by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Single-line comment should be preceded by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1515SA1515** + +_A single-line comment within C# code is not preceded by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1515SA1515.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1515SA1515 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1516sa1516.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1516sa1516.md new file mode 100644 index 0000000000..77f97fe837 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1516sa1516.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Elements should be separated by blank line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Elements should be separated by blank line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1516SA1516** + +_Adjacent C# elements are not separated by a blank line._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1516SA1516.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1516SA1516 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1517sa1517.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1517sa1517.md new file mode 100644 index 0000000000..d77ffb66ed --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1517sa1517.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain blank lines at start of file" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain blank lines at start of file + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1517SA1517** + +_The code file has blank lines at the start._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1517SA1517.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1517SA1517 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1518sa1518.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1518sa1518.md new file mode 100644 index 0000000000..39509af91a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1518sa1518.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use line endings correctly at end of file" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use line endings correctly at end of file + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1518SA1518** + +_Code should not contain blank lines at the end of the file_ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1518SA1518.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1518SA1518 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1609sa1610sa1609.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1609sa1610sa1609.md new file mode 100644 index 0000000000..d663e79304 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1609sa1610sa1609.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Property documentation should have value" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Property documentation should have value + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1609SA1610SA1609** + +``` +The XML header documentation for a C# property does not contain a tag. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1609SA1610SA1609.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1609SA1610SA1609 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1609sa1610sa1610.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1609sa1610sa1610.md new file mode 100644 index 0000000000..80267f88d9 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1609sa1610sa1610.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Property documentation should have value text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Property documentation should have value text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1609SA1610SA1610** + +``` +The XML header documentation for a C# property contains an empty tag. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1609SA1610SA1610.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1609SA1610SA1610 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1615sa1616sa1615.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1615sa1616sa1615.md new file mode 100644 index 0000000000..985890b5f6 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1615sa1616sa1615.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Element return value should be documented" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Element return value should be documented + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1615SA1616SA1615** + +_A C# element is missing documentation for its return value._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1615SA1616SA1615.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1615SA1616SA1615 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1615sa1616sa1616.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1615sa1616sa1616.md new file mode 100644 index 0000000000..f23f090168 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1615sa1616sa1616.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Element return value documentation should have text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Element return value documentation should have text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1615SA1616SA1616** + +``` +The tag within a C# element's documentation header is empty. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1615SA1616SA1616.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1615SA1616SA1616 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1617sa1617.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1617sa1617.md new file mode 100644 index 0000000000..5bfea89753 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1617sa1617.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Void return value should not be documented" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Void return value should not be documented + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1617SA1617** + +``` +A C# code element does not contain a return value, or returns void, but the documentation header for the element contains a tag. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1617SA1617.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1617SA1617 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1626sa1626.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1626sa1626.md new file mode 100644 index 0000000000..dc94037d16 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1626sa1626.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Single-line comments should not use documentation style slashes" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Single-line comments should not use documentation style slashes + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1626SA1626** + +_The C# code contains a single-line comment which begins with three forward slashes in a row._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1626SA1626.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1626SA1626 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1629sa1629.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1629sa1629.md new file mode 100644 index 0000000000..028934a0b2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1629sa1629.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Documentation text should end with a period" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Documentation text should end with a period + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1629SA1629** + +_A section of the XML header documentation for a C# element does not end with a period._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1629SA1629.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1629SA1629 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1642sa1643sa1642.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1642sa1643sa1642.md new file mode 100644 index 0000000000..bf82169f76 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1642sa1643sa1642.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Constructor summary documentation should begin with standard text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Constructor summary documentation should begin with standard text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1642SA1643SA1642** + +_The XML documentation header for a C# constructor does not contain the appropriate summary text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1642SA1643SA1642.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1642SA1643SA1642 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1642sa1643sa1643.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1642sa1643sa1643.md new file mode 100644 index 0000000000..17b6f28e4a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1642sa1643sa1643.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Destructor summary documentation should begin with standard text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Destructor summary documentation should begin with standard text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1642SA1643SA1643** + +_The XML documentation header for a C# finalizer does not contain the appropriate summary text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1642SA1643SA1643.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1642SA1643SA1643 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sa1651sa1651.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1651sa1651.md new file mode 100644 index 0000000000..22ee866774 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sa1651sa1651.md @@ -0,0 +1,113 @@ +--- +sidebar_label: "Do not use placeholder elements" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not use placeholder elements + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SA1651SA1651** + +``` +The element documentation contains a element. +``` + + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SA1651SA1651.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SA1651SA1651 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1600.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1600.md new file mode 100644 index 0000000000..74e01cef9e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1600.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Elements should be documented" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Elements should be documented + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1600** + +_A C# code element is missing a documentation header._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1600.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1600 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1601.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1601.md new file mode 100644 index 0000000000..971746036f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1601.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Partial elements should be documented" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Partial elements should be documented + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1601** + +_A C# partial element is missing a documentation header._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1601.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1601 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1602.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1602.md new file mode 100644 index 0000000000..d56f9b11f3 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1602.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Enumeration items should be documented" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Enumeration items should be documented + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1602** + +_An item within a C# enumeration is missing an Xml documentation header._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1602.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1602 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1633.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1633.md new file mode 100644 index 0000000000..1b8a2f9fb9 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1633.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File should have header" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File should have header + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1633** + +_A C# code file is missing a standard file header._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1633.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1633 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1634.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1634.md new file mode 100644 index 0000000000..d2df8d0f62 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1634.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header should show copyright" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header should show copyright + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1634** + +_The file header at the top of a C# code file is missing a copyright tag._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1634.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1634 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1635.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1635.md new file mode 100644 index 0000000000..6005db094e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1635.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header should have copyright text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header should have copyright text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1635** + +_The file header at the top of a C# code file is missing copyright text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1635.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1635 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1636.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1636.md new file mode 100644 index 0000000000..35a79cc40f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1636.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header copyright text should match" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header copyright text should match + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1636** + +_The file header at the top of a C# code file does not contain the appropriate copyright text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1636.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1636 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1637.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1637.md new file mode 100644 index 0000000000..d014427d20 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1637.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header should contain file name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header should contain file name + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1637** + +_The file header at the top of a C# code file is missing the file name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1637.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1637 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1638.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1638.md new file mode 100644 index 0000000000..69e75f7a64 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1638.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header file name documentation should match file name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header file name documentation should match file name + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1638** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1638.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1638 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1639.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1639.md new file mode 100644 index 0000000000..1e3dc0b119 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1639.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header should have summary" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header should have summary + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1639** + +_The file header at the top of a C# code file does not contain a filled-in summary tag._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1639.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1639 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1640.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1640.md new file mode 100644 index 0000000000..3ce541b93e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1640.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header should have valid company text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header should have valid company text + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1640** + +_The file header at the top of a C# code file does not contain company name text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1640.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1640 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1641.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1641.md new file mode 100644 index 0000000000..044a37f9ef --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1641.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File header company name text should match" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File header company name text should match + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1641** + +_The file header at the top of a C# code file does not contain the appropriate company name text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1641.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1641 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1649.md b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1649.md new file mode 100644 index 0000000000..9c585ded3f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/settingsfilesa1649.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "File name should match first type name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# File name should match first type name + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1649** + +_The file name of a C# code file does not match the first type declared in the file._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SettingsFileSA1649.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SettingsFileSA1649 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sx1101sx1101.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sx1101sx1101.md new file mode 100644 index 0000000000..539dd943b7 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sx1101sx1101.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Do not prefix local calls with 'this.'" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Do not prefix local calls with 'this.' + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SX1101SX1101** + +_A call to an instance member of the local class or a base class is prefixed with `this.`._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SX1101SX1101.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SX1101SX1101 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sx1309sx1309.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sx1309sx1309.md new file mode 100644 index 0000000000..c25878e716 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sx1309sx1309.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Field names should begin with underscore" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Field names should begin with underscore + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SX1309SX1309** + +_A field name in C# does not begin with an underscore._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SX1309SX1309.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SX1309SX1309 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/sx1309sx1309s.md b/docs/recipes/csharp/recipes/stylecop/analyzers/sx1309sx1309s.md new file mode 100644 index 0000000000..7e14be396c --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/sx1309sx1309s.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Static field names should begin with underscore" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Static field names should begin with underscore + +**org.openrewrite.csharp.recipes.stylecop.analyzers.SX1309SX1309S** + +_A static field name in C# does not begin with an underscore._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/SX1309SX1309S.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe SX1309SX1309S +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1000.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1000.md new file mode 100644 index 0000000000..6a9531bb5f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1000.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Keywords should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Keywords should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1000** + +_The spacing around a C# keyword is incorrect._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1000.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1000 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1001.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1001.md new file mode 100644 index 0000000000..fb6a334af2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1001.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Commas should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Commas should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1001** + +_The spacing around a comma is incorrect, within a C# code file._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1001.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1001 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1002.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1002.md new file mode 100644 index 0000000000..cf7d89e26a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1002.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Semicolons should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Semicolons should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1002** + +_The spacing around a semicolon is incorrect, within a C# code file._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1002.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1002 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1006.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1006.md new file mode 100644 index 0000000000..e45f3e81c8 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1006.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Preprocessor keywords should not be preceded by space" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Preprocessor keywords should not be preceded by space + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1006** + +_A C# preprocessor-type keyword is preceded by space._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1006.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1006 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1007.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1007.md new file mode 100644 index 0000000000..b38dc390e2 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1007.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Operator keyword should be followed by space" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Operator keyword should be followed by space + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1007** + +_The operator keyword within a C# operator overload method is not followed by any whitespace._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1007.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1007 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1008.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1008.md new file mode 100644 index 0000000000..a74a4e0f70 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1008.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening parenthesis should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening parenthesis should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1008** + +_An opening parenthesis within a C# statement is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1008.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1008 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1009.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1009.md new file mode 100644 index 0000000000..6cedcef965 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1009.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing parenthesis should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing parenthesis should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1009** + +_A closing parenthesis within a C# statement is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1009.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1009 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1010.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1010.md new file mode 100644 index 0000000000..ee89af441f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1010.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening square brackets should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening square brackets should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1010** + +_An opening square bracket within a C# statement is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1010.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1010 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1011.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1011.md new file mode 100644 index 0000000000..3cf7578700 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1011.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing square brackets should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing square brackets should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1011** + +_A closing square bracket within a C# statement is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1011.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1011 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1012.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1012.md new file mode 100644 index 0000000000..e34859fff4 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1012.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening braces should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening braces should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1012** + +_An opening brace within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1012.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1012 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1013.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1013.md new file mode 100644 index 0000000000..2a577af019 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1013.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing braces should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing braces should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1013** + +_A closing brace within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1013.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1013 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1014.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1014.md new file mode 100644 index 0000000000..03179f8cfb --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1014.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening generic brackets should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening generic brackets should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1014** + +_An opening generic bracket within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1014.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1014 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1015.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1015.md new file mode 100644 index 0000000000..05c1d212cb --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1015.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing generic brackets should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing generic brackets should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1015** + +_A closing generic bracket within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1015.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1015 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1016.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1016.md new file mode 100644 index 0000000000..20220a70e4 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1016.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening attribute brackets should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening attribute brackets should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1016** + +_An opening attribute bracket within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1016.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1016 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1017.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1017.md new file mode 100644 index 0000000000..23dfbbbbad --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1017.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing attribute brackets should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing attribute brackets should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1017** + +_A closing attribute bracket within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1017.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1017 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1019.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1019.md new file mode 100644 index 0000000000..97e278099e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1019.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Member access symbols should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Member access symbols should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1019** + +_The spacing around a member access symbol is incorrect, within a C# code file._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1019.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1019 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1020.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1020.md new file mode 100644 index 0000000000..63b0b4321e --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1020.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Increment decrement symbols should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Increment decrement symbols should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1020** + +_An increment or decrement symbol within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1020.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1020 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1021.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1021.md new file mode 100644 index 0000000000..8afce55b32 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1021.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Negative signs should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Negative signs should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1021** + +_A negative sign within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1021.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1021 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1022.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1022.md new file mode 100644 index 0000000000..181c30f188 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1022.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Positive signs should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Positive signs should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1022** + +_A positive sign within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1022.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1022 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1023.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1023.md new file mode 100644 index 0000000000..0e089ca261 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1023.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Dereference and access of symbols should be spaced correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Dereference and access of symbols should be spaced correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1023** + +_A dereference symbol or an access-of symbol within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1023.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1023 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1024.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1024.md new file mode 100644 index 0000000000..f231f575e3 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1024.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Colons Should Be Spaced Correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Colons Should Be Spaced Correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1024** + +_A colon within a C# element is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1024.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1024 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1026.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1026.md new file mode 100644 index 0000000000..bb50f2709b --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1026.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Code should not contain space after new or stackalloc keyword in implicitly typed array allocation" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Code should not contain space after new or stackalloc keyword in implicitly typed array allocation + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1026** + +_An implicitly typed array allocation within a C# code file is not spaced correctly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1026.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1026 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1110.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1110.md new file mode 100644 index 0000000000..2fda080cf9 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1110.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Opening parenthesis or bracket should be on declaration line" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Opening parenthesis or bracket should be on declaration line + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1110** + +_The opening parenthesis or bracket is not placed on the same line as the method/indexer/attribute/array name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1110.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1110 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1111.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1111.md new file mode 100644 index 0000000000..daf0a54e65 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1111.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing parenthesis should be on line of last parameter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing parenthesis should be on line of last parameter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1111** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1111.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1111 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1112.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1112.md new file mode 100644 index 0000000000..0b5a785ef0 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1112.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Closing parenthesis should be on line of opening parenthesis" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Closing parenthesis should be on line of opening parenthesis + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1112** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1112.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1112 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1113.md b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1113.md new file mode 100644 index 0000000000..03b696242a --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/tokenspacingsa1113.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Comma should be on the same line as previous parameter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Comma should be on the same line as previous parameter + +**org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1113** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/TokenSpacingSA1113.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe TokenSpacingSA1113 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1200.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1200.md new file mode 100644 index 0000000000..c79b9dec6f --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1200.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using directives should be placed correctly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using directives should be placed correctly + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1200** + +_A C# using directive is placed outside of a namespace element._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1200.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1200 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1208.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1208.md new file mode 100644 index 0000000000..2fbfb7df52 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1208.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "System using directives should be placed before other using directives" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# System using directives should be placed before other using directives + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1208** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1208.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1208 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1209.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1209.md new file mode 100644 index 0000000000..7facaf8747 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1209.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using alias directives should be placed after other using directives" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using alias directives should be placed after other using directives + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1209** + +_A using-alias directive is positioned before a regular using directive._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1209.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1209 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1210.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1210.md new file mode 100644 index 0000000000..1a60f671f5 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1210.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using directives should be ordered alphabetically by namespace" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using directives should be ordered alphabetically by namespace + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1210** + +_The using directives within a C# code file are not sorted alphabetically by namespace._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1210.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1210 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1211.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1211.md new file mode 100644 index 0000000000..192764c4d1 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1211.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using alias directives should be ordered alphabetically by alias name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using alias directives should be ordered alphabetically by alias name + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1211** + +_The using-alias directives within a C# code file are not sorted alphabetically by alias name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1211.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1211 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1216.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1216.md new file mode 100644 index 0000000000..99e51fa9b1 --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1216.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using static directives should be placed at the correct location." +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using static directives should be placed at the correct location. + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1216** + +_A using static directive is positioned before a regular or after an alias using directive._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1216.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1216 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1217.md b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1217.md new file mode 100644 index 0000000000..2d3e58472b --- /dev/null +++ b/docs/recipes/csharp/recipes/stylecop/analyzers/usingsa1217.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Using static directives should be ordered alphabetically" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using static directives should be ordered alphabetically + +**org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1217** + +_All using static directives should be ordered alphabetically._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/stylecop/analyzers/UsingSA1217.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UsingSA1217 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/README.md b/docs/recipes/csharp/recipes/wpfanalyzers/README.md new file mode 100644 index 0000000000..5b069e6322 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/README.md @@ -0,0 +1,60 @@ +# Wpfanalyzers + +## Recipes + +* [A readonly DependencyProperty must be set with DependencyPropertyKey](./usedependencypropertykeyfixwpf0040.md) +* [Accessor method for attached property should have standard documentation text](./documentationfixwpf0061.md) +* [Add MarkupExtensionReturnType attribute](./markupextensionreturntypeattributefixwpf0080.md) +* [Add ValueConversion attribute](./attachedpropertybrowsablefortypeattributefixwpf0071.md) +* [Add ValueConversion attribute (unknown types)](./valueconversionattributefixwpf0073.md) +* [Add [AttachedPropertyBrowsableForType]](./attachedpropertybrowsablefortypeattributefixwpf0033.md) +* [Add [ConstructorArgument]](./constructorargumentattributefixwpf0083.md) +* [Add [TemplatePart] to the type](./addattributelistfixwpf0130.md) +* [Add default field to converter](./adddefaultmemberfixwpf0070.md) +* [Backing field for a DependencyProperty should be static and readonly](./makefieldstaticreadonlyfixwpf0030.md) +* [Backing field for a DependencyProperty should match registered name](./renamememberfixwpf0001.md) +* [Backing field for a DependencyPropertyKey should match registered name](./renamememberfixwpf0002.md) +* [Backing field for a RoutedCommand should be static and readonly](./makefieldstaticreadonlyfixwpf0123.md) +* [Backing field for a RoutedEvent should match registered name](./renamememberfixwpf0100.md) +* [Backing member for DependencyProperty should have standard documentation text](./documentationfixwpf0060.md) +* [Backing member for RoutedEvent should have standard documentation text](./documentationfixwpf0108.md) +* [Backing member for a RoutedEvent should be static and readonly](./makefieldstaticreadonlyfixwpf0107.md) +* [CLR accessor for attached property must match registered type](./useregisteredtypefixwpf0013.md) +* [CLR method for a DependencyProperty must match registered name](./renamememberfixwpf0004.md) +* [CLR property for a DependencyProperty should match registered name](./renamememberfixwpf0003.md) +* [CLR property type should match registered type](./useregisteredtypefixwpf0012.md) +* [Cast sender to containing type](./castfixwpf0021.md) +* [Cast sender to correct type](./castfixwpf0019.md) +* [Cast value to correct type](./castfixwpf0020.md) +* [Cast value to correct type](./castfixwpf0022.md) +* [Containing type should be used as registered owner](./usecontainingtypefixwpf0011.md) +* [Containing type should be used as registered owner](./usecontainingtypefixwpf0101.md) +* [DependencyPropertyKey member must be declared before DependencyProperty member](./movefixwpf0031.md) +* [Don't set DataContext and Style using SetCurrentValue](./usesetvaluefixwpf0043.md) +* [MarkupExtensionReturnType must use correct return type](./changetypeoffixwpf0081.md) +* [Name of CoerceValueCallback should match registered name](./renamememberfixwpf0006.md) +* [Name of PropertyChangedCallback should match registered name](./renamememberfixwpf0005.md) +* [Name of ValidateValueCallback should match registered name](./renamememberfixwpf0007.md) +* [Name of the event should match registered name](./renamememberfixwpf0102.md) +* [Name the invoked method OnEventName](./renamememberfixwpf0090.md) +* [Name the invoked method OnEventName](./renamememberfixwpf0091.md) +* [Parameter type should be nullable](./makenullablefixwpf0024.md) +* [Property changed callback should have standard documentation text](./documentationfixwpf0062.md) +* [Register containing member name as name for routed command](./usenameoffixwpf0120.md) +* [Register containing type as owner for routed command](./usecontainingtypefixwpf0121.md) +* [Register name and owning type for routed command](./registerroutedcommandfixwpf0122.md) +* [Set mutable dependency properties using SetCurrentValue](./usesetcurrentvaluefixwpf0041.md) +* [StyleTypedProperty is missing](./addattributelistfixwpf0176.md) +* [The callback is trivial, convert to lambda](./converttolambdafixwpf0023.md) +* [Use SetValue in setter](./usesetvaluefixwpf0035.md) +* [Use containing member as key when creating a ComponentResourceKey](./componentresourcekeyfixwpf0141.md) +* [Use containing type when creating a ComponentResourceKey](./componentresourcekeyfixwpf0140.md) +* [Use correct argument for [AttachedPropertyBrowsableForType]](./attachedpropertybrowsablefortypeargumentfixwpf0034.md) +* [Use correct handler type](./usecorrectdelegatefixwpf0092.md) +* [Use nameof() instead of constant](./usenameoffixwpf0151.md) +* [Use nameof() instead of literal](./usenameoffixwpf0150.md) +* [ValueConversion must use correct types](./valueconversionattributeargumentfixwpf0072.md) +* [XmlnsDefinitions does not map all namespaces with public types](./xmlnsdefinitionfixwpf0052.md) +* [[ConstructorArgument] must match](./constructorargumentattributeargumentfixwpf0082.md) + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/addattributelistfixwpf0130.md b/docs/recipes/csharp/recipes/wpfanalyzers/addattributelistfixwpf0130.md new file mode 100644 index 0000000000..795d13ba99 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/addattributelistfixwpf0130.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add [TemplatePart] to the type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add [TemplatePart] to the type + +**org.openrewrite.csharp.recipes.wpfanalyzers.AddAttributeListFixWPF0130** + +_Add [TemplatePart] to the type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/AddAttributeListFixWPF0130.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddAttributeListFixWPF0130 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/addattributelistfixwpf0176.md b/docs/recipes/csharp/recipes/wpfanalyzers/addattributelistfixwpf0176.md new file mode 100644 index 0000000000..124a6d065b --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/addattributelistfixwpf0176.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "StyleTypedProperty is missing" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# StyleTypedProperty is missing + +**org.openrewrite.csharp.recipes.wpfanalyzers.AddAttributeListFixWPF0176** + +_StyleTypedProperty is missing._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/AddAttributeListFixWPF0176.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddAttributeListFixWPF0176 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/adddefaultmemberfixwpf0070.md b/docs/recipes/csharp/recipes/wpfanalyzers/adddefaultmemberfixwpf0070.md new file mode 100644 index 0000000000..b3cf42ecad --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/adddefaultmemberfixwpf0070.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add default field to converter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add default field to converter + +**org.openrewrite.csharp.recipes.wpfanalyzers.AddDefaultMemberFixWPF0070** + +_Add default field to converter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/AddDefaultMemberFixWPF0070.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AddDefaultMemberFixWPF0070 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeargumentfixwpf0034.md b/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeargumentfixwpf0034.md new file mode 100644 index 0000000000..4ba325bf7c --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeargumentfixwpf0034.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use correct argument for [AttachedPropertyBrowsableForType]" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use correct argument for [AttachedPropertyBrowsableForType] + +**org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeArgumentFixWPF0034** + +_Use correct argument for [AttachedPropertyBrowsableForType]._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/AttachedPropertyBrowsableForTypeArgumentFixWPF0034.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AttachedPropertyBrowsableForTypeArgumentFixWPF0034 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeattributefixwpf0033.md b/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeattributefixwpf0033.md new file mode 100644 index 0000000000..118b689f59 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeattributefixwpf0033.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add [AttachedPropertyBrowsableForType]" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add [AttachedPropertyBrowsableForType] + +**org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeAttributeFixWPF0033** + +_Add [AttachedPropertyBrowsableForType]._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/AttachedPropertyBrowsableForTypeAttributeFixWPF0033.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AttachedPropertyBrowsableForTypeAttributeFixWPF0033 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeattributefixwpf0071.md b/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeattributefixwpf0071.md new file mode 100644 index 0000000000..afcea5f89e --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/attachedpropertybrowsablefortypeattributefixwpf0071.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add ValueConversion attribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add ValueConversion attribute + +**org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeAttributeFixWPF0071** + +_Add ValueConversion attribute._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/AttachedPropertyBrowsableForTypeAttributeFixWPF0071.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe AttachedPropertyBrowsableForTypeAttributeFixWPF0071 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0019.md b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0019.md new file mode 100644 index 0000000000..15ad9f91b7 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0019.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Cast sender to correct type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Cast sender to correct type + +**org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0019** + +_Cast sender to correct type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/CastFixWPF0019.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CastFixWPF0019 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0020.md b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0020.md new file mode 100644 index 0000000000..e573423387 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0020.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Cast value to correct type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Cast value to correct type + +**org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0020** + +_Cast value to correct type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/CastFixWPF0020.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CastFixWPF0020 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0021.md b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0021.md new file mode 100644 index 0000000000..35c6501ea7 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0021.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Cast sender to containing type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Cast sender to containing type + +**org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0021** + +_Cast sender to correct type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/CastFixWPF0021.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CastFixWPF0021 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0022.md b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0022.md new file mode 100644 index 0000000000..d398f980be --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/castfixwpf0022.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Cast value to correct type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Cast value to correct type + +**org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0022** + +_Cast value to correct type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/CastFixWPF0022.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe CastFixWPF0022 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/changetypeoffixwpf0081.md b/docs/recipes/csharp/recipes/wpfanalyzers/changetypeoffixwpf0081.md new file mode 100644 index 0000000000..d5e1845dd5 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/changetypeoffixwpf0081.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "MarkupExtensionReturnType must use correct return type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# MarkupExtensionReturnType must use correct return type + +**org.openrewrite.csharp.recipes.wpfanalyzers.ChangeTypeofFixWPF0081** + +_MarkupExtensionReturnType must use correct return type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ChangeTypeofFixWPF0081.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ChangeTypeofFixWPF0081 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/componentresourcekeyfixwpf0140.md b/docs/recipes/csharp/recipes/wpfanalyzers/componentresourcekeyfixwpf0140.md new file mode 100644 index 0000000000..6ea2dfaf93 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/componentresourcekeyfixwpf0140.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use containing type when creating a ComponentResourceKey" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use containing type when creating a ComponentResourceKey + +**org.openrewrite.csharp.recipes.wpfanalyzers.ComponentResourceKeyFixWPF0140** + +_Use containing type when creating a ComponentResourceKey._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ComponentResourceKeyFixWPF0140.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ComponentResourceKeyFixWPF0140 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/componentresourcekeyfixwpf0141.md b/docs/recipes/csharp/recipes/wpfanalyzers/componentresourcekeyfixwpf0141.md new file mode 100644 index 0000000000..537be55160 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/componentresourcekeyfixwpf0141.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use containing member as key when creating a ComponentResourceKey" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use containing member as key when creating a ComponentResourceKey + +**org.openrewrite.csharp.recipes.wpfanalyzers.ComponentResourceKeyFixWPF0141** + +_Use containing member as key when creating a ComponentResourceKey._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ComponentResourceKeyFixWPF0141.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ComponentResourceKeyFixWPF0141 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/constructorargumentattributeargumentfixwpf0082.md b/docs/recipes/csharp/recipes/wpfanalyzers/constructorargumentattributeargumentfixwpf0082.md new file mode 100644 index 0000000000..d180b3b172 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/constructorargumentattributeargumentfixwpf0082.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "[ConstructorArgument] must match" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# [ConstructorArgument] must match + +**org.openrewrite.csharp.recipes.wpfanalyzers.ConstructorArgumentAttributeArgumentFixWPF0082** + +_[ConstructorArgument] must match the name of the constructor parameter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ConstructorArgumentAttributeArgumentFixWPF0082.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConstructorArgumentAttributeArgumentFixWPF0082 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/constructorargumentattributefixwpf0083.md b/docs/recipes/csharp/recipes/wpfanalyzers/constructorargumentattributefixwpf0083.md new file mode 100644 index 0000000000..0ddb7748e1 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/constructorargumentattributefixwpf0083.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add [ConstructorArgument]" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add [ConstructorArgument] + +**org.openrewrite.csharp.recipes.wpfanalyzers.ConstructorArgumentAttributeFixWPF0083** + +_Add [ConstructorArgument] for the property._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ConstructorArgumentAttributeFixWPF0083.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConstructorArgumentAttributeFixWPF0083 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/converttolambdafixwpf0023.md b/docs/recipes/csharp/recipes/wpfanalyzers/converttolambdafixwpf0023.md new file mode 100644 index 0000000000..2d3e337d2f --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/converttolambdafixwpf0023.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "The callback is trivial, convert to lambda" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# The callback is trivial, convert to lambda + +**org.openrewrite.csharp.recipes.wpfanalyzers.ConvertToLambdaFixWPF0023** + +_The callback is trivial, convert to lambda for better locality._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ConvertToLambdaFixWPF0023.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ConvertToLambdaFixWPF0023 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0060.md b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0060.md new file mode 100644 index 0000000000..6b82624b51 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0060.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing member for DependencyProperty should have standard documentation text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing member for DependencyProperty should have standard documentation text + +**org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0060** + +_Backing member for DependencyProperty should have standard documentation text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/DocumentationFixWPF0060.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DocumentationFixWPF0060 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0061.md b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0061.md new file mode 100644 index 0000000000..affb739f99 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0061.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Accessor method for attached property should have standard documentation text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Accessor method for attached property should have standard documentation text + +**org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0061** + +_Accessor method for attached property should have standard documentation text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/DocumentationFixWPF0061.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DocumentationFixWPF0061 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0062.md b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0062.md new file mode 100644 index 0000000000..558f17339d --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0062.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Property changed callback should have standard documentation text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Property changed callback should have standard documentation text + +**org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0062** + +_Property changed callback should have standard documentation text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/DocumentationFixWPF0062.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DocumentationFixWPF0062 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0108.md b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0108.md new file mode 100644 index 0000000000..6baa805da3 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/documentationfixwpf0108.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing member for RoutedEvent should have standard documentation text" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing member for RoutedEvent should have standard documentation text + +**org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0108** + +_Backing member for RoutedEvent should have standard documentation text._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/DocumentationFixWPF0108.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe DocumentationFixWPF0108 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0030.md b/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0030.md new file mode 100644 index 0000000000..9e8a2a3562 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0030.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing field for a DependencyProperty should be static and readonly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing field for a DependencyProperty should be static and readonly + +**org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0030** + +_Backing field for a DependencyProperty should be static and readonly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/MakeFieldStaticReadonlyFixWPF0030.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeFieldStaticReadonlyFixWPF0030 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0107.md b/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0107.md new file mode 100644 index 0000000000..3d43f979f2 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0107.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing member for a RoutedEvent should be static and readonly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing member for a RoutedEvent should be static and readonly + +**org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0107** + +_Backing member for a RoutedEvent should be static and readonly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/MakeFieldStaticReadonlyFixWPF0107.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeFieldStaticReadonlyFixWPF0107 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0123.md b/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0123.md new file mode 100644 index 0000000000..18a28122ee --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/makefieldstaticreadonlyfixwpf0123.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing field for a RoutedCommand should be static and readonly" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing field for a RoutedCommand should be static and readonly + +**org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0123** + +_Backing field for a RoutedCommand should be static and readonly._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/MakeFieldStaticReadonlyFixWPF0123.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeFieldStaticReadonlyFixWPF0123 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/makenullablefixwpf0024.md b/docs/recipes/csharp/recipes/wpfanalyzers/makenullablefixwpf0024.md new file mode 100644 index 0000000000..c71148bed7 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/makenullablefixwpf0024.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Parameter type should be nullable" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Parameter type should be nullable + +**org.openrewrite.csharp.recipes.wpfanalyzers.MakeNullableFixWPF0024** + +_Parameter type should be nullable._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/MakeNullableFixWPF0024.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MakeNullableFixWPF0024 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/markupextensionreturntypeattributefixwpf0080.md b/docs/recipes/csharp/recipes/wpfanalyzers/markupextensionreturntypeattributefixwpf0080.md new file mode 100644 index 0000000000..0d2b4d07de --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/markupextensionreturntypeattributefixwpf0080.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add MarkupExtensionReturnType attribute" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add MarkupExtensionReturnType attribute + +**org.openrewrite.csharp.recipes.wpfanalyzers.MarkupExtensionReturnTypeAttributeFixWPF0080** + +_Add MarkupExtensionReturnType attribute._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/MarkupExtensionReturnTypeAttributeFixWPF0080.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MarkupExtensionReturnTypeAttributeFixWPF0080 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/movefixwpf0031.md b/docs/recipes/csharp/recipes/wpfanalyzers/movefixwpf0031.md new file mode 100644 index 0000000000..a4ee81c215 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/movefixwpf0031.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "DependencyPropertyKey member must be declared before DependencyProperty member" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# DependencyPropertyKey member must be declared before DependencyProperty member + +**org.openrewrite.csharp.recipes.wpfanalyzers.MoveFixWPF0031** + +_DependencyPropertyKey member must be declared before DependencyProperty member._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/MoveFixWPF0031.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe MoveFixWPF0031 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/registerroutedcommandfixwpf0122.md b/docs/recipes/csharp/recipes/wpfanalyzers/registerroutedcommandfixwpf0122.md new file mode 100644 index 0000000000..1b16d836b5 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/registerroutedcommandfixwpf0122.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Register name and owning type for routed command" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Register name and owning type for routed command + +**org.openrewrite.csharp.recipes.wpfanalyzers.RegisterRoutedCommandFixWPF0122** + +_Register containing type as owner for routed command._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RegisterRoutedCommandFixWPF0122.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RegisterRoutedCommandFixWPF0122 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0001.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0001.md new file mode 100644 index 0000000000..65f145614f --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0001.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing field for a DependencyProperty should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing field for a DependencyProperty should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0001** + +_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._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0001.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0001 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0002.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0002.md new file mode 100644 index 0000000000..fa585fa7b9 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0002.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing field for a DependencyPropertyKey should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing field for a DependencyPropertyKey should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0002** + +_A DependencyPropertyKey's backing field must be named with the name it is registered with suffixed by 'PropertyKey'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0002.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0002 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0003.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0003.md new file mode 100644 index 0000000000..fbf1acb977 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0003.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "CLR property for a DependencyProperty should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# CLR property for a DependencyProperty should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0003** + +_A CLR property accessor for a DependencyProperty must have the same name as the DependencyProperty is registered with._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0003.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0003 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0004.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0004.md new file mode 100644 index 0000000000..e31cc674d6 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0004.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "CLR method for a DependencyProperty must match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# CLR method for a DependencyProperty must match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0004** + +_CLR methods for accessing a DependencyProperty must have names matching the name the DependencyProperty is registered with._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0004.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0004 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0005.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0005.md new file mode 100644 index 0000000000..b6702f3927 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0005.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Name of PropertyChangedCallback should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Name of PropertyChangedCallback should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0005** + +_Name of PropertyChangedCallback should match registered name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0005.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0005 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0006.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0006.md new file mode 100644 index 0000000000..a400f38bed --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0006.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Name of CoerceValueCallback should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Name of CoerceValueCallback should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0006** + +_Name of CoerceValueCallback should match registered name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0006.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0006 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0007.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0007.md new file mode 100644 index 0000000000..196742ccc2 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0007.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Name of ValidateValueCallback should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Name of ValidateValueCallback should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0007** + +_Name of ValidateValueCallback should match registered name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0007.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0007 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0090.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0090.md new file mode 100644 index 0000000000..8e01c1284a --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0090.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Name the invoked method OnEventName" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Name the invoked method OnEventName + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0090** + +_Name the invoked method OnEventName._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0090.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0090 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0091.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0091.md new file mode 100644 index 0000000000..73574a3b68 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0091.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Name the invoked method OnEventName" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Name the invoked method OnEventName + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0091** + +_Name the invoked method OnEventName._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0091.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0091 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0100.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0100.md new file mode 100644 index 0000000000..2c4c56f15b --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0100.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Backing field for a RoutedEvent should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Backing field for a RoutedEvent should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0100** + +_A routed event's backing field should be named with the name it is registered with suffixed by 'Event'._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0100.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0100 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0102.md b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0102.md new file mode 100644 index 0000000000..b0e25cb38f --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/renamememberfixwpf0102.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Name of the event should match registered name" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Name of the event should match registered name + +**org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0102** + +_Name of the event should match registered name._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/RenameMemberFixWPF0102.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe RenameMemberFixWPF0102 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0011.md b/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0011.md new file mode 100644 index 0000000000..9699b900bf --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0011.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Containing type should be used as registered owner" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Containing type should be used as registered owner + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0011** + +_When registering a DependencyProperty register containing type as owner type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseContainingTypeFixWPF0011.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseContainingTypeFixWPF0011 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0101.md b/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0101.md new file mode 100644 index 0000000000..b6f6780c61 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0101.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Containing type should be used as registered owner" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Containing type should be used as registered owner + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0101** + +_When registering a RoutedEvent register containing type as owner type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseContainingTypeFixWPF0101.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseContainingTypeFixWPF0101 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0121.md b/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0121.md new file mode 100644 index 0000000000..137d970006 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usecontainingtypefixwpf0121.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Register containing type as owner for routed command" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Register containing type as owner for routed command + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0121** + +_Register containing type as owner for routed command._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseContainingTypeFixWPF0121.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseContainingTypeFixWPF0121 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usecorrectdelegatefixwpf0092.md b/docs/recipes/csharp/recipes/wpfanalyzers/usecorrectdelegatefixwpf0092.md new file mode 100644 index 0000000000..18f17ccef5 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usecorrectdelegatefixwpf0092.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use correct handler type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use correct handler type + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseCorrectDelegateFixWPF0092** + +_Use correct handler type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseCorrectDelegateFixWPF0092.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseCorrectDelegateFixWPF0092 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usedependencypropertykeyfixwpf0040.md b/docs/recipes/csharp/recipes/wpfanalyzers/usedependencypropertykeyfixwpf0040.md new file mode 100644 index 0000000000..a1a5b1b252 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usedependencypropertykeyfixwpf0040.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "A readonly DependencyProperty must be set with DependencyPropertyKey" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# A readonly DependencyProperty must be set with DependencyPropertyKey + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseDependencyPropertyKeyFixWPF0040** + +_A readonly DependencyProperty must be set with DependencyPropertyKey._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseDependencyPropertyKeyFixWPF0040.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseDependencyPropertyKeyFixWPF0040 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0120.md b/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0120.md new file mode 100644 index 0000000000..e91c81f04c --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0120.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Register containing member name as name for routed command" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Register containing member name as name for routed command + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0120** + +_Register containing member name as name for routed command._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseNameofFixWPF0120.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseNameofFixWPF0120 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0150.md b/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0150.md new file mode 100644 index 0000000000..8bdad30a5f --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0150.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use nameof() instead of literal" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use nameof() instead of literal + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0150** + +_Use nameof() as it is less fragile than string literal._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseNameofFixWPF0150.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseNameofFixWPF0150 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0151.md b/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0151.md new file mode 100644 index 0000000000..774f0d7751 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usenameoffixwpf0151.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use nameof() instead of constant" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use nameof() instead of constant + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0151** + +_Use nameof() as it is less fragile than constant._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseNameofFixWPF0151.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseNameofFixWPF0151 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/useregisteredtypefixwpf0012.md b/docs/recipes/csharp/recipes/wpfanalyzers/useregisteredtypefixwpf0012.md new file mode 100644 index 0000000000..b69c98a421 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/useregisteredtypefixwpf0012.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "CLR property type should match registered type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# CLR property type should match registered type + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseRegisteredTypeFixWPF0012** + +_CLR property type should match registered type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseRegisteredTypeFixWPF0012.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseRegisteredTypeFixWPF0012 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/useregisteredtypefixwpf0013.md b/docs/recipes/csharp/recipes/wpfanalyzers/useregisteredtypefixwpf0013.md new file mode 100644 index 0000000000..0ddbafce7e --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/useregisteredtypefixwpf0013.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "CLR accessor for attached property must match registered type" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# CLR accessor for attached property must match registered type + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseRegisteredTypeFixWPF0013** + +_CLR accessor for attached property must match registered type._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseRegisteredTypeFixWPF0013.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseRegisteredTypeFixWPF0013 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usesetcurrentvaluefixwpf0041.md b/docs/recipes/csharp/recipes/wpfanalyzers/usesetcurrentvaluefixwpf0041.md new file mode 100644 index 0000000000..8cb2532736 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usesetcurrentvaluefixwpf0041.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Set mutable dependency properties using SetCurrentValue" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Set mutable dependency properties using SetCurrentValue + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseSetCurrentValueFixWPF0041** + +_Prefer setting mutable dependency properties using SetCurrentValue._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseSetCurrentValueFixWPF0041.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseSetCurrentValueFixWPF0041 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usesetvaluefixwpf0035.md b/docs/recipes/csharp/recipes/wpfanalyzers/usesetvaluefixwpf0035.md new file mode 100644 index 0000000000..5d621d890e --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usesetvaluefixwpf0035.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Use SetValue in setter" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Use SetValue in setter + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseSetValueFixWPF0035** + +_Use SetValue in setter._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseSetValueFixWPF0035.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseSetValueFixWPF0035 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/usesetvaluefixwpf0043.md b/docs/recipes/csharp/recipes/wpfanalyzers/usesetvaluefixwpf0043.md new file mode 100644 index 0000000000..757e7f18ac --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/usesetvaluefixwpf0043.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Don't set DataContext and Style using SetCurrentValue" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Don't set DataContext and Style using SetCurrentValue + +**org.openrewrite.csharp.recipes.wpfanalyzers.UseSetValueFixWPF0043** + +_Set DataContext and Style using SetValue._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/UseSetValueFixWPF0043.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe UseSetValueFixWPF0043 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/valueconversionattributeargumentfixwpf0072.md b/docs/recipes/csharp/recipes/wpfanalyzers/valueconversionattributeargumentfixwpf0072.md new file mode 100644 index 0000000000..5c9f26c102 --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/valueconversionattributeargumentfixwpf0072.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "ValueConversion must use correct types" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# ValueConversion must use correct types + +**org.openrewrite.csharp.recipes.wpfanalyzers.ValueConversionAttributeArgumentFixWPF0072** + +_ValueConversion must use correct types._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ValueConversionAttributeArgumentFixWPF0072.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ValueConversionAttributeArgumentFixWPF0072 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/valueconversionattributefixwpf0073.md b/docs/recipes/csharp/recipes/wpfanalyzers/valueconversionattributefixwpf0073.md new file mode 100644 index 0000000000..4b62d66b4c --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/valueconversionattributefixwpf0073.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "Add ValueConversion attribute (unknown types)" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Add ValueConversion attribute (unknown types) + +**org.openrewrite.csharp.recipes.wpfanalyzers.ValueConversionAttributeFixWPF0073** + +_Add ValueConversion attribute (unknown types)._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/ValueConversionAttributeFixWPF0073.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe ValueConversionAttributeFixWPF0073 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + + diff --git a/docs/recipes/csharp/recipes/wpfanalyzers/xmlnsdefinitionfixwpf0052.md b/docs/recipes/csharp/recipes/wpfanalyzers/xmlnsdefinitionfixwpf0052.md new file mode 100644 index 0000000000..8564fdaa8e --- /dev/null +++ b/docs/recipes/csharp/recipes/wpfanalyzers/xmlnsdefinitionfixwpf0052.md @@ -0,0 +1,110 @@ +--- +sidebar_label: "XmlnsDefinitions does not map all namespaces with public types" +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# XmlnsDefinitions does not map all namespaces with public types + +**org.openrewrite.csharp.recipes.wpfanalyzers.XmlnsDefinitionFixWPF0052** + +_XmlnsDefinitions does not map all namespaces with public types._ + +## Recipe source + +[GitHub](https://github.com/openrewrite/rewrite-csharp/blob/main/rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/wpfanalyzers/XmlnsDefinitionFixWPF0052.java), +[Issue Tracker](https://github.com/openrewrite/rewrite-csharp/issues), +[Maven Central](https://central.sonatype.com/artifact/org.openrewrite/rewrite-csharp/) + +This recipe is available under the [Moderne Source Available License](https://docs.moderne.io/licensing/moderne-source-available-license). + + +## Usage + +This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite:rewrite-csharp` in your build file or by running a shell command (in which case no build changes are needed): + + + + + +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. + +```shell title="shell" +mod run . --recipe XmlnsDefinitionFixWPF0052 +``` + +If the recipe is not available locally, then you can install it using: +```shell +mod config recipes jar install org.openrewrite:rewrite-csharp:{{VERSION_ORG_OPENREWRITE_REWRITE_CSHARP}} +``` + + + +## See how this recipe works across multiple open-source repositories + +import RecipeCallout from '@site/src/components/ModerneLink'; + + + +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. + +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. +## Data Tables + + + + +### Source files that had results +**org.openrewrite.table.SourcesFileResults** + +_Source files that were modified by the recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | +| Recipe that made changes | The specific recipe that made a change. | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | +| Cycle | The recipe cycle in which the change was made. | + + + + + +### Source files that errored on a recipe +**org.openrewrite.table.SourcesFileErrors** + +_The details of all errors produced by a recipe run._ + +| Column Name | Description | +| ----------- | ----------- | +| Source path | The file that failed to parse. | +| Recipe that made changes | The specific recipe that made a change. | +| Stack trace | The stack trace of the failure. | + + + + + +### Recipe performance +**org.openrewrite.table.RecipeRunStats** + +_Statistics used in analyzing the performance of recipes._ + +| Column Name | Description | +| ----------- | ----------- | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | +| Source file count | The number of source files the recipe ran over. | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | +| Max scanning time (ns) | The max time scanning any one source file. | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | +| Max edit time (ns) | The max time editing any one source file. | + + + +