Commit Graph
7 Commits
Author SHA1 Message Date
Robert C. Martin c757ec79a6 Find Go coverage by module import path.
Why: `go test -coverprofile` names each file by its module import path.
crapper found it only by path suffix, which works when the module path
happens to end with the project-relative path. A module in a subdirectory
whose name differs from its directory (`svc/go.mod` declaring
`module example.com/api`) scored 0% for every function.

What: `go_import_name` builds the profile's name for a file from the
nearest go.mod's module line and the path inside the module. The bundle
remembers its root and looks a Go file up by that name first, then by the
old suffix match. `_nearest` becomes the shared `nearest_marker` so
coverage and the runners find go.mod the same way. mutator uses
`go_import_name` so the two tools cannot drift.

Proof: three new coverage specs (nested module with a different name,
quoted module path, fallback without a module line) failed first, now
pass; 147 pass, the 2 bb/uml environment failures are unchanged.
crapper on changed code: max CRAP 9.0 (percent_for, unchanged), new
functions <= 7.0. dryer: no candidates in changed files. mutator on the
changed lines: 13/13 killed.
2026-11-10 12:38:04 -06:00
Robert C. Martin 6fd92c4c9b Fix Python coverage for top-level modules
Why: for a top-level file like carddav.py, crapper passed --source=carddav.py
to coverage.py, which expects a module name, so the file always scored 0%.
What: python_sources now converts files to module names via _source_name.
Proof: new failing test in tests/test_runners.py, then fix; suite 146/146;
carddav.py now measured at 100% in family-and-friends-store.
2026-10-21 09:16:07 -05:00
Robert C. Martin 9f1bead298 Fix the coverage, git, and Clojure bugs, and bring CRAP under 10.
A path in a built-in coverage command is one argument, a failed custom coverage command does not read a stale report, and git failures exit with git's status. The Clojure reader honors discards, metadata, and character literals. Long functions are split so every score is under 10 except the option switch.
2026-10-03 17:27:59 -05:00
Robert C. Martin f0cb973110 Count ?? and ?., Express handlers, and JavaScript files, and score missing coverage as 0%. 2026-10-03 08:49:10 -05:00
Robert C. Martin ce3895211e Add tests for the branches the first mutation run left alive. 2026-10-02 10:36:31 -05:00
Robert C. Martin bd91c20ebf Route function extraction through a Language type.
Each language implements functions. An unknown language returns nothing.
2026-09-30 08:38:14 -05:00
Robert C. Martin a4b5fc2aed Add a multi-language CRAP tool that writes .metrics/crap.edn for uml-viewer.
Score Clojure, Java, Go, TypeScript, Rust, and Python with each language's complexity rules and coverage report.
2026-09-30 08:21:44 -05:00