Skip to content

lsoft/ExtractConstantsAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
            {
            }
        }
    }

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors