Index
architecture
Architecture rules — AST-based structural analysis.
CircularImportRule
dataclass
Bases: ProjectRule
Detect circular imports via import graph + Tarjan's SCC algorithm.
Source code in packages/axm-audit/src/axm_audit/core/rules/architecture/__init__.py
rule_id
property
Unique identifier for this rule.
check(project_path)
Check for circular imports in the project.
Source code in packages/axm-audit/src/axm_audit/core/rules/architecture/__init__.py
CouplingMetricRule
dataclass
Bases: ProjectRule
Measure module coupling via fan-in/fan-out analysis.
Scores based on the number of modules whose fan-out exceeds
the threshold: score = 100 - N(over) * 5.
Source code in packages/axm-audit/src/axm_audit/core/rules/architecture/__init__.py
rule_id
property
Unique identifier for this rule.
check(project_path)
Check coupling metrics for the project.
Scans src/ for import fan-out per module and compares each
against its effective threshold (base + orchestrator bonus +
per-module overrides).
Returns a :class:CheckResult with:
text— one line per violation formatted as• {leaf_module} fo:{fan_out}/{threshold} {⚠|✘}(Nonewhen all modules pass).details— fullover_thresholdlist with FQN, fan-out, role, effective threshold, and severity.fix_hint— human-readable remediation listing.
Source code in packages/axm-audit/src/axm_audit/core/rules/architecture/__init__.py
GodClassRule
dataclass
Bases: ProjectRule
Detect god classes (too many lines or methods).
Classes acknowledged (with a justifying reason) under
[[tool.axm-audit.god_class.acknowledged]] are exempt — for legitimate
wide-contract facades (e.g. a backend implementing several segregated ABCs)
whose method count is the contract surface, not responsibility creep.
Source code in packages/axm-audit/src/axm_audit/core/rules/architecture/__init__.py
| Python | |
|---|---|
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
rule_id
property
Unique identifier for this rule.
check(project_path)
Check for god classes in the project.
Scans all classes under src/ and flags those exceeding
:attr:max_lines or :attr:max_methods.
The text field uses the compact format
• {basename}:{ClassName} {lines}L/{methods}M (one line per
violation), or None when no god classes are found.