Help us improve
Share bugs, ideas, or general feedback.
From tdder
Calculates code mass using the Absolute Priority Premise heuristic to compare implementation complexity during TDD refactoring phases. Lower mass indicates simpler code.
npx claudepluginhub t1/tdder --plugin tdderHow this skill is triggered — by the user, by Claude, or both
Slash command
/tdder:appThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Objective heuristic for comparing code quality by assigning mass values to code components.
Analyzes code structure, complexity, and quality using cyclomatic and cognitive complexity metrics, detects code smells like long methods and god objects, and suggests refactoring strategies.
Measuring and reducing cyclomatic complexity and cognitive complexity to improve maintainability.
Applies SOLID principles, TDD, and clean code practices to transform code quality. Use when writing, refactoring, reviewing, or debugging code.
Share bugs, ideas, or general feedback.
Objective heuristic for comparing code quality by assigning mass values to code components. Lower total mass indicates simpler code.
| Component | Mass | Examples |
|---|---|---|
| Constant | 1 | 5, "hello", true, [] |
| Binding | 1 | amount, userName, result |
| Invocation | 2 | calculate(), Math.max(a, b) |
| Conditional | 4 | if, switch, case, ?: |
| Loop | 5 | while, for, forEach, map |
| Assignment | 6 | x = 5, count++, list.add() |
Total Mass = (constants x 1) + (bindings x 1) + (invocations x 2)
+ (conditionals x 4) + (loops x 5) + (assignments x 6)
Lower mass = Better code (all else being equal).
final fields and local variables are Bindings (1), not Assignments (6)Simple Design Rule #2 trumps APP - Choose clarity over low mass. APP helps choose between equivalent clear solutions.