Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .codeint/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"source_sets": {
"production": {
"boundaries": {
"metric_version": 3,
"metric_version": 4,
"findings": []
},
"cognitive_complexity": {
Expand Down Expand Up @@ -836,11 +836,11 @@
"findings": []
},
"import_cycles": {
"metric_version": 2,
"metric_version": 3,
"findings": []
},
"orphan_files": {
"metric_version": 1,
"metric_version": 2,
"findings": []
},
"verbosity": {
Expand Down Expand Up @@ -2126,7 +2126,7 @@
"findings": []
},
"import_cycles": {
"metric_version": 2,
"metric_version": 3,
"findings": []
},
"verbosity": {
Expand Down Expand Up @@ -2175,7 +2175,7 @@
"findings": []
},
"import_cycles": {
"metric_version": 2,
"metric_version": 3,
"findings": []
},
"verbosity": {
Expand All @@ -2186,15 +2186,15 @@
},
"dependencies": {
"dev_in_production_dependencies": {
"metric_version": 1,
"metric_version": 2,
"findings": []
},
"unlisted_dependencies": {
"metric_version": 1,
"metric_version": 2,
"findings": []
},
"unused_dependencies": {
"metric_version": 1,
"metric_version": 2,
"findings": []
}
}
Expand Down
16 changes: 8 additions & 8 deletions .codeint/ratchet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"production": {
"boundaries": {
"ceiling": 0.0,
"metric_version": 3
"metric_version": 4
},
"cognitive_complexity": {
"ceiling": 0.0311,
Expand All @@ -24,11 +24,11 @@
},
"import_cycles": {
"ceiling": 0.0,
"metric_version": 2
"metric_version": 3
},
"orphan_files": {
"ceiling": 0.0,
"metric_version": 1
"metric_version": 2
},
"verbosity": {
"ceiling": 0.0002,
Expand All @@ -54,7 +54,7 @@
},
"import_cycles": {
"ceiling": 0.0,
"metric_version": 2
"metric_version": 3
},
"verbosity": {
"ceiling": 0.0,
Expand All @@ -80,7 +80,7 @@
},
"import_cycles": {
"ceiling": 0.0,
"metric_version": 2
"metric_version": 3
},
"verbosity": {
"ceiling": 0.0,
Expand All @@ -91,15 +91,15 @@
"dependencies": {
"dev_in_production_dependencies": {
"ceiling": 0.0,
"metric_version": 1
"metric_version": 2
},
"unlisted_dependencies": {
"ceiling": 0.0,
"metric_version": 1
"metric_version": 2
},
"unused_dependencies": {
"ceiling": 0.0,
"metric_version": 1
"metric_version": 2
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ Read [docs/guide/philosophy-and-architecture.md](./docs/guide/philosophy-and-arc
| Rust | 24.5% to 70.4% | 17.6% to 58.5% | 4.7% to 37.7% | 0.0% to 0.5% | 0.0% to 61.1% | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| PHP | 6.4% to 59.1% | 4.4% to 54.2% | 2.5% to 20.9% | 0.0% to 0.4% | 0.0% to 13.3% | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| Dart | 3.9% to 49.5% | 0.0% to 37.8% | 2.7% to 25.7% | 0.0% to 1.1% | 6.1% to 60.0% | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| Python | 23.9% to 71.7% | 24.9% to 63.7% | 1.1% to 22.0% | 0.0% to 1.1% | 0.0% to 44.6% | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| Python | 23.9% to 71.7% | 24.9% to 63.7% | 1.1% to 22.0% | 0.0% to 1.1% | 0.0% to 49.2% | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| Go | 30.4% to 74.6% | 30.6% to 67.1% | 3.4% to 24.3% | 0.0% to 0.4% | 0.0% to 0.0% | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| SQL | 0.0% to 91.8% | 0.0% to 90.2% | 0.0% to 90.9% | 0.0% to 0.0% | N/A | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |
| Shell | 36.4% to 93.0% | 21.8% to 82.8% | 0.3% to 71.3% | 0.0% to 3.1% | N/A | [ADR 0035](./docs/adr/0035-stratified-100-repository-reference-panels.md) |

Measured on `2026-12-02` at commit `9e3f53053618` on `eval/panels.json` (Erosion v2, Cognitive complexity v2, Duplication v3, Verbosity v4, Import cycles v2).
See the [calibration provenance](./docs/evaluation.md#reference-range-panels) for the dataset and measured binary for each Metric.

See [docs/guide/languages.md](./docs/guide/languages.md) for per-language rules and sample repository timings.
See [docs/evaluation.md](./docs/evaluation.md) for the published calibration report (`eval/panels.json`: 927 panel entries across 918 unique repositories), native-parser recall, and agent-reviewed audit; `corpus-eval` CI validates the separate 40-repository `eval/corpus.json` manifest.
Expand Down
13 changes: 13 additions & 0 deletions crates/cli/tests/fixtures/finding-id-stability.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@
"packages/lib/src/index.d.ts": "export declare function greet(name: string): string;\n",
"packages/lib/src/index.ts": "import { helper } from '@ws/app';\nexport function greet(name: string): string { return helper(name); }\n"
}
},
"php_composer_application_scope": {
"files": {
"a/composer.json": "{\"autoload\": {\"psr-4\": {\"App\\\\\": \"src/\"}}}",
"a/src/Dev/Impl.php": "<?php namespace App\\Dev; class Impl {}",
"a/src/Missing/Impl.php": "<?php namespace App\\Missing; class Impl {}",
"a/src/Run/Impl.php": "<?php namespace App\\Run; class Impl {}",
"a/src/Service.php": "<?php namespace App; use App\\Entry; class Service {}",
"b/composer.json": "{\"autoload\": {\"psr-4\": {\"App\\\\\": \"src/\"}}, \"require\": {\"app/run\": \"*\"}, \"require-dev\": {\"app/dev\": \"*\"}}",
"b/src/Entry.php": "<?php namespace App; use App\\Service; use App\\Run\\Impl; use App\\Dev\\Impl; use App\\Missing\\Impl; class Entry {}",
"b/src/Service.php": "<?php namespace App; class Service {}",
"codeint.json": "{\"entry_points\": [\"b/src/Entry.php\"], \"boundaries\": {\"zones\": {\"a\": {\"patterns\": [\"a/**\"]}, \"b\": {\"patterns\": [\"b/**\"]}}, \"rules\": [{\"from\": \"b\", \"deny\": [\"a\"]}]}}"
}
}
}
}
76 changes: 42 additions & 34 deletions crates/cli/tests/integration/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ fn report_without_findings(files: usize, source_lines: u64) -> String {
findings: []\n \
import_cycles:\n \
ratio: 0\n \
metric_version: 2\n \
metric_version: 3\n \
reference_range:\n \
low: 0\n \
high: 0.182\n \
source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n \
source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n \
modules_in_import_cycles: 0\n \
modules: {files}\n \
findings: []\n \
Expand Down Expand Up @@ -712,12 +712,13 @@ fn the_typescript_and_javascript_report_shows_the_approved_reference_ranges_with

assert_success(&output);
let source = "codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618";
for (metric, low, high) in [
("erosion", "0.187", "0.671"),
("cognitive_complexity", "0.121", "0.532"),
("duplication", "0.018", "0.252"),
("verbosity", "0", "0.002"),
("import_cycles", "0", "0.182"),
let import_cycles_source = "codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196";
for (metric, low, high, source) in [
("erosion", "0.187", "0.671", source),
("cognitive_complexity", "0.121", "0.532", source),
("duplication", "0.018", "0.252", source),
("verbosity", "0", "0.002", source),
("import_cycles", "0", "0.182", import_cycles_source),
] {
let expected = format!(
" reference_range:\n low: {low}\n high: {high}\n source: \"{source}\"\n"
Expand Down Expand Up @@ -1734,11 +1735,11 @@ fn no_import_cycles(modules: usize) -> String {
format!(
"import_cycles:\n\
\x20 ratio: 0\n\
\x20 metric_version: 2\n\
\x20 metric_version: 3\n\
\x20 reference_range:\n\
\x20 low: 0\n\
\x20 high: 0.182\n\
\x20 source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n\
\x20 source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n\
\x20 modules_in_import_cycles: 0\n\
\x20 modules: {modules}\n\
\x20 findings: []\n\
Expand Down Expand Up @@ -1781,11 +1782,11 @@ fn three_files_that_import_each_other_in_a_ring_form_one_import_cycle() {
concat!(
"import_cycles:\n",
" ratio: 0.75\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 3\n",
" modules: 4\n",
" findings[1]:\n",
Expand Down Expand Up @@ -1829,11 +1830,11 @@ fn a_cycle_through_a_tsconfig_path_alias_is_an_import_cycle() {
concat!(
"import_cycles:\n",
" ratio: 0.6667\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 2\n",
" modules: 3\n",
" findings[1]:\n",
Expand Down Expand Up @@ -1893,11 +1894,11 @@ fn a_cycle_through_the_exports_of_a_workspace_package_is_an_import_cycle() {
concat!(
"import_cycles:\n",
" ratio: 0.6667\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 2\n",
" modules: 3\n",
" findings[1]:\n",
Expand Down Expand Up @@ -1968,11 +1969,11 @@ fn dynamic_import_and_require_are_runtime_imports_that_close_a_cycle() {
"import_cycles:\n",
" ratio: 0.75\n",
" metric_version: ",
"2\n",
"3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 3\n",
" modules: 4\n",
" findings[1]:\n",
Expand Down Expand Up @@ -2038,11 +2039,11 @@ fn a_mixed_import_or_reexport_with_one_value_specifier_closes_an_import_cycle()
concat!(
"import_cycles:\n",
" ratio: 1\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 3\n",
" modules: 3\n",
" findings[1]:\n",
Expand Down Expand Up @@ -2083,11 +2084,11 @@ fn each_import_cycle_is_a_finding_and_the_ratio_counts_every_module_in_one() {
concat!(
"import_cycles:\n",
" ratio: 0.7143\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 5\n",
" modules: 7\n",
" findings[3]:\n",
Expand Down Expand Up @@ -2190,11 +2191,11 @@ fn each_source_set_finds_import_cycles_only_among_its_own_modules() {
concat!(
"import_cycles:\n",
" ratio: 1\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 2\n",
" modules: 2\n",
" findings[1]:\n",
Expand Down Expand Up @@ -2230,11 +2231,11 @@ fn unresolved_imports_are_counted_and_listed_and_the_import_cycle_is_still_found
concat!(
"import_cycles:\n",
" ratio: 0.6667\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 2\n",
" modules: 3\n",
" findings[1]:\n",
Expand Down Expand Up @@ -2356,11 +2357,11 @@ fn an_unresolved_import_of_a_test_file_is_reported_in_the_test_source_set_only()
concat!(
"import_cycles:\n",
" ratio: 0\n",
" metric_version: 2\n",
" metric_version: 3\n",
" reference_range:\n",
" low: 0\n",
" high: 0.182\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618\"\n",
" source: \"codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196\"\n",
" modules_in_import_cycles: 0\n",
" modules: 1\n",
" findings: []\n",
Expand Down Expand Up @@ -3389,11 +3390,11 @@ fn format_json_prints_the_report_as_json_with_the_documented_shape() {
},
"import_cycles": {
"ratio": 0.0,
"metric_version": 2,
"metric_version": 3,
"reference_range": {
"low": 0.0,
"high": 0.182,
"source": "codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618"
"source": "codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196"
},
"modules_in_import_cycles": 0,
"modules": 1,
Expand Down Expand Up @@ -4188,7 +4189,7 @@ fn format_markdown_lists_each_metric_over_its_budget_after_the_metric_table_and_
assert_eq!(output.status.code(), Some(1));
assert!(
stdout(&output).contains(
"| 0 to 0.182, source: codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618 |\n\
"| 0 to 0.182, source: codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196 |\n\
\n\
## Over Budget\n\
\n\
Expand All @@ -4212,7 +4213,7 @@ fn format_markdown_lists_the_ratios_of_each_workspace_package_after_the_metric_t
assert_success(&output);
assert!(
stdout(&output).contains(
"| 0 to 0.182, source: codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-02, commit 9e3f53053618 |\n\
"| 0 to 0.182, source: codeint stratified panel of 100 TypeScript and JavaScript repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196 |\n\
\n\
## Workspace packages\n\
\n\
Expand Down Expand Up @@ -5955,7 +5956,7 @@ fn check_calibrated_reference_ranges(

#[test]
fn go_check_displays_calibrated_reference_ranges_next_to_go_values() {
check_calibrated_reference_ranges(
let report = check_calibrated_reference_ranges(
&[
("go.mod", "module example.com/demo\n\ngo 1.24\n"),
(
Expand All @@ -5969,9 +5970,16 @@ fn go_check_displays_calibrated_reference_ranges_next_to_go_values() {
("cognitive_complexity", 0.306, 0.671),
("verbosity", 0.000, 0.004),
("duplication", 0.034, 0.243),
("import_cycles", 0.0, 0.0),
],
);
assert_eq!(
report["source_sets"]["production"]["import_cycles"]["reference_range"],
serde_json::json!({
"low": 0.0,
"high": 0.0,
"source": "codeint stratified panel of 100 Go repositories, ADR 0035, eval/panels.json, 2026-12-03, commit 2887c2d69196"
})
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/integration/ratchet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn ratchet_update_creates_tightens_refuses_regression_resets_and_refreshes_versi
);
assert_eq!(
created["dependencies"]["unused_dependencies"]["metric_version"],
1
2
);

let (_, _) = run_codeint_text(repo.path(), &["check", "--format", "json"], 0);
Expand Down
Loading
Loading