Using an abstract modifier in a class declaration indicates that a class is intended only to be a base class of other classes and not instantiated by itself. Due to this, there is no need for public or internal constructors within. Any initialization logic should be added in a private,private protected, or protected constructor.
Non-Compliant Code Examples
abstractclassFoo{internalFoo(){//...}}
abstractclassFoo{publicFoo(){//...}}
Compliant Code Examples
abstractclassFoo{privateprotectedFoo(){//...}}
abstractclassFoo{privateFoo(){//...}}
abstractclassFoo{protectedFoo(){//...}}
Seamless integrations. Try Datadog Code Analysis
Datadog Code Analysis
Try this rule and analyze your code with Datadog Code Analysis
How to use this rule
1
2
rulesets:- csharp-best-practices # Rules to enforce C# best practices.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Analysis scans to your CI pipelines