Detectors Overview
archlint comes with 28+ built-in detectors categorized by the type of architectural or code quality issue they identify.
Dependency Issues
| Detector | ID | Description | Default |
|---|---|---|---|
| Cyclic Dependencies | cycles | Circular dependencies between files | ✅ |
| Type Cycles | circular_type_deps | Type-only circular dependencies | ❌ |
| Package Cycles | package_cycles | Cyclic dependencies between packages | ❌ |
| Layer Violation | layer_violation | Violations of defined architectural layers | ❌ |
| SDP Violation | sdp_violation | Stable Dependencies Principle violations | ❌ |
Module & Class Design
| Detector | ID | Description | Default |
|---|---|---|---|
| God Module | god_module | Modules with too many responsibilities | ✅ |
| Hub Module | hub_module | Highly connected "hub" modules | ❌ |
| Low Cohesion | lcom | Classes with low internal cohesion (LCOM4) | ❌ |
| High Coupling | high_coupling | Modules with too many dependencies | ❌ |
| Scattered Module | module_cohesion | Functionality scattered across too many files | ❌ |
| Feature Envy | feature_envy | Methods that use more of another class than their own | ❌ |
Code Quality & Organization
| Detector | ID | Description | Default |
|---|---|---|---|
| Dead Code | dead_code | Unused exports | ✅ |
| Dead Symbols | dead_symbols | Unused local functions and variables | ✅ |
| Orphan Types | orphan_types | Types not connected to the codebase | ✅ |
| Barrel Abuse | barrel_file | Large barrel files causing coupling | ✅ |
| Primitive Obsession | primitive_obsession | Overuse of primitives instead of domain types | ❌ |
Complexity & Size
| Detector | ID | Description | Default |
|---|---|---|---|
| High Complexity | complexity | Functions with high cyclomatic complexity | ✅ |
| Deep Nesting | deep_nesting | Deeply nested code blocks | ✅ |
| Long Parameters | long_params | Functions with too many parameters | ✅ |
| Large File | large_file | Source files that are too large | ✅ |
Change Patterns
| Detector | ID | Description | Default |
|---|---|---|---|
| Shotgun Surgery | shotgun_surgery | Changes requiring modification in many files | ❌ |
| Unstable Interface | unstable_interface | Frequently changing public interfaces | ❌ |
Runtime & Safety
| Detector | ID | Description | Default |
|---|---|---|---|
| Test Leakage | test_leakage | Test code leaking into production | ❌ |
| Vendor Coupling | vendor_coupling | Tight coupling to external libraries | ❌ |
| Hub Dependency | hub_dependency | Over-reliance on external packages | ❌ |
| Side Effect Import | side_effect_import | Imports that trigger side effects | ✅ |
| Shared Mutable State | shared_state | Exported mutable variables | ❌ |
Architectural Metrics
| Detector | ID | Description | Default |
|---|---|---|---|
| Abstractness Violation | abstractness | Pain/Useless zones (I+A metric) | ❌ |
| Scattered Config | scattered_config | Configuration spread across many files | ❌ |
| Code Clone | code_clone | Duplicated code across the project | ✅ |