code-analysis-warnings
Skill1 starsChanged 4 months agoMITView on GitHub
Microsoft code analysis CA warning meanings and examples
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when the build reports enabled CA* diagnostics.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code analysis warnings
Use this skill when the build reports enabled CA* diagnostics.
Code analysis diagnostics (CA)
CA1069 - Enums should not have duplicate values
What it flags: The enum defines two names with the same constant value without an intentional alias pattern.
Example:
- Bad:
enum Status { New = 0, Created = 0 }. - Fix: remove the duplicate value or document intentional aliases with a clear naming pattern.
CA1501 - Avoid excessive inheritance
What it flags: A type has an inheritance chain that is too deep to maintain comfortably.
Example:
- Bad:
ScreenEditor : EditorBase : ControlBase : FrameworkBase : .... - Fix: flatten the hierarchy or move behavior into composed services.
CA1502 - Avoid excessive complexity
What it flags: A method has high cyclomatic complexity.
Example:
- Bad: one method has many nested
if,switch, and loop branches. - Fix: split decision logic into smaller named methods or strategies.
CA1505 - Avoid unmaintainable code
What it flags: A type or assembly has a high maintainability risk.
Example:
- Bad: a class grows into a large mixed-responsibility workflow.
- Fix: split responsibilities and reduce complexity before adding more behavior.
CA1506 - Avoid excessive class coupling
What it flags: A type or method is coupled to too many other types.
Example:
- Bad: one service directly references many unrelated concrete types.
- Fix: introduce narrower abstractions or move orchestration to focused collaborators.
CA1822 - Mark members as static
What it flags: An instance member does not use instance state and can be static.
Example:
- Bad:
public int Count() => 1;in an instance class without using instance members. - Fix: mark it
staticor use actual instance state.
CA2002 - Do not lock on objects with weak identity
What it flags: Code locks on a type, string, or other object with weak identity.
Example:
- Bad:
lock (typeof(Cache))orlock ("global"). - Fix: lock on a private readonly object owned by the class.
CA2011 - Avoid infinite recursion in property accessors
What it flags: A property accessor recursively reads or writes the same property.
Example:
- Bad:
set { Count = value; }inside theCountproperty. - Fix: assign the backing field:
_count = value;.
CA2211 - Non-constant fields should not be visible
What it flags: A visible static field is mutable and can be changed globally.
Example:
- Bad:
public static List<string> Names;. - Fix: expose a property with controlled mutation or make the field readonly/private.
In this repository73 other files it gives its agents.
- unsafe-checker/AGENTS.mdAGENTS.md
- activity-tracingSkill
- beadsSkill
- coding-guidelinesSkill
- compiler-warningsSkill
- core-actionbookSkill
- core-agent-browserSkill
- core-dynamic-skillsSkill
- core-fix-skill-docsSkill
- csharp-compiler-warningsSkill
- csharp-object-designSkill
- domain-cliSkill
- domain-cloud-nativeSkill
- domain-embeddedSkill
- domain-fintechSkill
- domain-iotSkill
- domain-mlSkill
- domain-webSkill
- dotnet-pinvokeSkill
- dreamSkill
- gitSkill
- ide-warningsSkill
- karpathy-guidelinesSkill
- m01-ownershipSkill
- m02-resourceSkill
- m03-mutabilitySkill
- m04-zero-costSkill
- m05-type-drivenSkill
- m06-error-handlingSkill
- m07-concurrencySkill
- m09-domainSkill
- m10-performanceSkill
- m11-ecosystemSkill
- m12-lifecycleSkill
- m13-domain-errorSkill
- m14-mental-modelSkill
- m15-anti-patternSkill
- mermaidSkill
- meta-cognition-parallelSkill
- modern-csharpSkill
- msbuild-warningsSkill
- mx-creative-keypadSkill
- nuget-warningsSkill
- nullability-warningsSkill
- rcs-warningsSkill
- renpySkill
- rust-call-graphSkill
- rust-code-navigatorSkill
- rust-dailySkill
- rust-deps-visualizerSkill
- rust-google-styleSkill
- rust-learnerSkill
- rust-object-designSkill
- rust-refactor-helperSkill
- rust-routerSkill
- rust-skill-creatorSkill
- rustSkill
- rust-symbol-analyzerSkill
- rust-trait-explorerSkill
- translationsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

