ExtractConstantsAnalyzer 1.1.0

dotnet add package ExtractConstantsAnalyzer --version 1.1.0
NuGet\Install-Package ExtractConstantsAnalyzer -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ExtractConstantsAnalyzer" Version="1.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExtractConstantsAnalyzer --version 1.1.0
#r "nuget: ExtractConstantsAnalyzer, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ExtractConstantsAnalyzer as a Cake Addin
#addin nuget:?package=ExtractConstantsAnalyzer&version=1.1.0

// Install ExtractConstantsAnalyzer as a Cake Tool
#tool nuget:?package=ExtractConstantsAnalyzer&version=1.1.0

ExtractConstantsAnalyzer

Roslyn analyzer for detection and extraction inline constants into the C# const fields.

From this:

    class MyClass
    {
        public void MyMethod(string myarg1, int myarg2)
        {
            if(myarg1 == "MyConstant")
            {
            }
            if(myarg2 == 123)
            {
            }
        }
    }

to this:

    class MyClass
    {
        private const int MyClass123 = 123;
        private const string MyClassMyConstant = "MyConstant";

        public void MyMethod(string myarg1, int myarg2)
        {
            if(myarg1 == MyClassMyConstant)
            {
            }
            if(myarg2 == MyClass123)
            {
            }
        }
    }
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 184 2/3/2023
1.0.0 171 2/3/2023