ReadonlycategoryRule category for grouping.
ReadonlydescriptionRule description explaining what it checks.
ReadonlyidUnique rule identifier (scoped to plugin). Format: "plugin-name:rule-name" (e.g., "angular-standalone:component-not-standalone")
ReadonlynameHuman-readable rule name.
ReadonlyseverityRule severity level.
ReadonlytagsTags for filtering and search.
Analyze a source file and return findings.
Analysis context with file, project, and API access
Promise resolving to array of analysis results
God Switch Analysis Rule (
solid:god-switch) - detects switch statements with too many cases (Open/Closed Principle violation).Reports every switch statement with more case clauses (excluding
default) than the threshold. The threshold is read fromcontext.config.solid.godSwitch.maxCases(default: 10). Each result carries the case count, a classification of the switch expression (switchType) and a confidence score. Recommended refactorings: factory with strategy objects, polymorphism, strategy or command pattern; GodSwitchTransformRule applies the factory variant.Example