Skip to content

Rule Reference

This reference lists all diagnostics in Cratis.Architecture.CodeAnalysis.

RuleTitleSeverityDescription
CRARCH0001Exception type namingWarningException types must use domain terminology and avoid the generic Exception suffix
CRARCH0002No built-in exception typesWarningThrowing framework exceptions hides domain intent
CRARCH0003No postfixes on class namesWarningClass names must describe domain concepts, not technical roles
CRARCH0004No Features in namespaceWarningNamespace paths should stay domain-oriented and avoid framework-driven structure names
CRARCH0005No regionsWarningRegion directives usually indicate files that need better separation of responsibilities
CRARCH0006Logging via LoggerMessageWarningStructured, source-generated logging ensures consistency and better performance
CRARCH0007No IServiceProvider injectionWarningService locator patterns hide dependencies and make code harder to reason about
CRARCH0008Use is null checksWarningPattern matching null checks are the preferred and consistent style
CRARCH0009Use string interpolationWarningInterpolated strings are clearer and easier to maintain
CRARCH0010Constructor fan-outWarningToo many dependencies indicate excessive responsibility in one type
CRARCH0011File length thresholdWarningVery large files are difficult to understand and maintain
CRARCH0012async void forbiddenErrorasync void methods hide failures and cannot be awaited in regular flows
CRARCH0013No blocking on asyncWarningBlocking asynchronous calls can cause deadlocks and reliability issues
CRARCH0014No test types in productionErrorProduction assemblies must remain independent of test-only infrastructure
CRARCH0015Static class naming conventionWarningStatic utility types follow strict naming conventions to improve discoverability
CRARCH0016Unused interfacesWarningSpeculative interfaces without implementations add unnecessary abstraction
CRARCH0017Namespace must align with folder pathWarningNamespace and folder alignment improves navigability and consistency
CRARCH0018Avoid concrete type injectionWarningConstructor dependencies should favor abstractions for loose coupling
CRARCH0019Avoid Async postfix on method namesWarningMethod names should avoid unnecessary suffixes unless sync/async pairs exist
CRARCH0020Handle asynchronous callsWarningFire-and-forget calls can hide failures and produce nondeterministic behavior
CRARCH0021Serializable attribute not allowedWarningLegacy serialization attributes are not part of modern Cratis architecture guidance
CRARCH0022Private modifier not allowedWarningPrivate is implicit in C#, so explicit modifiers add noise
CRARCH0023Use typed logger categoryWarningTyped logger categories align log events with the producing type
CRARCH0024LoggerMessage container conventionsWarningLoggerMessage methods must live in convention-based containers for consistency
CRARCH0025Use Cratis Fundamentals tracesWarningTracing should flow through Cratis Fundamentals abstractions for consistency
CRARCH0026Use Cratis Fundamentals metricsWarningMetrics should use Cratis Fundamentals abstractions instead of raw instrument creation