@@ -41,20 +41,17 @@ Live sample report:
4141## Features
4242
4343- ** Clone detection** — function (CFG fingerprint), block (statement windows), and segment (report-only) clones
44- - ** Structural findings** — duplicated branch families, clone guard/exit divergence and clone-cohort drift (report-only)
45- - ** Quality metrics** — cyclomatic complexity, coupling (` CBO ` ), cohesion (` LCOM4 ` ), dependency cycles, dead code,
46- health score, type/docstring adoption coverage, current-run Cobertura coverage join, public API surface diff, and
47- report-only ` Overloaded Modules ` profiling
48- - ** Baseline governance** — separates accepted ** legacy** debt from ** new regressions** and lets CI fail ** only** on
49- what changed
50- - ** Reports** — interactive HTML, deterministic JSON/TXT plus Markdown and SARIF projections from one canonical report
51- - ** MCP server** — optional read-only surface for AI agents and IDEs, designed as a budget-aware guided control
52- surface for agentic development
53- - ** VS Code extension** — preview native client for CodeClone MCP with triage-first structural review, factual
54- ` Coverage Join ` overview support, and bounded in-IDE help topics
55- - ** Native client surfaces** — preview Claude Desktop bundle and Codex plugin over the same canonical MCP contract
44+ - ** Structural findings** — duplicated branch families, clone guard/exit divergence, and clone-cohort drift
45+ - ** Quality metrics** — cyclomatic complexity, coupling (CBO), cohesion (LCOM4), dependency cycles, dead code,
46+ health score, and overloaded-module profiling
47+ - ** Adoption & API** — type/docstring annotation coverage, public API surface inventory and baseline diff
48+ - ** Coverage Join** — fuse external Cobertura XML into the current run to surface coverage hotspots and scope gaps
49+ - ** Baseline governance** — separates accepted ** legacy** debt from ** new regressions** ; CI fails only on what changed
50+ - ** Reports** — interactive HTML, JSON, Markdown, SARIF, and text from one canonical report
51+ - ** MCP server** — optional read-only surface for AI agents and IDEs
52+ - ** IDE & agent clients** — VS Code extension, Claude Desktop bundle, and Codex plugin over the same MCP contract
5653- ** CI-first** — deterministic output, stable ordering, exit code contract, pre-commit support
57- - ** Fast** — incremental caching, parallel processing, warm-run optimization, and reproducible benchmark coverage
54+ - ** Fast** — incremental caching, parallel processing, warm-run optimization
5855
5956## Quick Start
6057
@@ -150,16 +147,12 @@ codeclone . --fail-on-typing-regression --fail-on-docstring-regression
150147codeclone . --api-surface --update-metrics-baseline
151148codeclone . --fail-on-api-break
152149
153- # Current-run Cobertura hotspot gate
150+ # Coverage Join — fuse external Cobertura XML into the review
154151codeclone . --coverage coverage.xml --fail-on-untested-hotspots --coverage-min 50
155152```
156153
157- In normal full-mode CLI output, CodeClone now surfaces adoption coverage
158- (` params ` , ` returns ` , ` docstrings ` , ` Any ` ) in the main ` Metrics ` block, and it
159- adds a ` Public API ` line when ` --api-surface ` facts are collected. Passing
160- ` --coverage FILE ` adds a ` Coverage ` line from external Cobertura XML, surfaces
161- joined details under HTML ` Quality -> Coverage Join ` and MCP/report
162- ` coverage_join ` , and does not update the clone baseline.
154+ Gate details:
155+ [ Metrics and quality gates] ( https://orenlab.github.io/codeclone/book/15-metrics-and-quality-gates/ )
163156
164157### Pre-commit
165158
@@ -179,10 +172,7 @@ repos:
179172## MCP Server
180173
181174Optional read-only MCP server for AI agents and IDE clients.
182- 21 tools + 10 resources — never mutates source, baselines, or repo state.
183- Compact summary and triage payloads make scope explicit: repository-wide health,
184- current focus, new-finding source-kind attribution, and when comparison is
185- proceeding without a valid baseline.
175+ Never mutates source, baselines, or repo state.
186176
187177` ` ` bash
188178uv tool install --pre "codeclone[mcp]" # or: uv pip install --pre "codeclone[mcp]"
@@ -191,9 +181,7 @@ codeclone-mcp --transport stdio # local (Claude Code, Codex, Copilot,
191181codeclone-mcp --transport streamable-http # remote / HTTP-only clients
192182```
193183
194- Docs:
195- [ MCP usage guide] ( https://orenlab.github.io/codeclone/mcp/ )
196- ·
184+ [ MCP usage guide] ( https://orenlab.github.io/codeclone/mcp/ ) ·
197185[ MCP interface contract] ( https://orenlab.github.io/codeclone/book/20-mcp-interface/ )
198186
199187### Native Client Surfaces
@@ -206,6 +194,10 @@ Docs:
206194
207195All three are thin wrappers over the same ` codeclone-mcp ` contract — no second analysis engine.
208196
197+ [ VS Code extension docs] ( https://orenlab.github.io/codeclone/book/21-vscode-extension/ ) ·
198+ [ Claude Desktop docs] ( https://orenlab.github.io/codeclone/book/22-claude-desktop-bundle/ ) ·
199+ [ Codex plugin docs] ( https://orenlab.github.io/codeclone/book/23-codex-plugin/ )
200+
209201## Configuration
210202
211203CodeClone can load project-level configuration from ` pyproject.toml ` :
@@ -231,6 +223,9 @@ segment_min_stmt = 10
231223
232224Precedence: CLI flags > ` pyproject.toml ` > built-in defaults.
233225
226+ Config reference:
227+ [ Config and defaults] ( https://orenlab.github.io/codeclone/book/04-config-and-defaults/ )
228+
234229## Baseline Workflow
235230
236231Baselines capture the current duplication state. Once committed, they become the CI reference point.
@@ -253,6 +248,8 @@ Full contract: [Baseline contract](https://orenlab.github.io/codeclone/book/06-b
253248
254249Contract errors (` 2 ` ) take precedence over gating failures (` 3 ` ).
255250
251+ Full policy: [ Exit codes and failure policy] ( https://orenlab.github.io/codeclone/book/03-contracts-exit-codes/ )
252+
256253## Reports
257254
258255| Format | Flag | Default path |
@@ -263,37 +260,12 @@ Contract errors (`2`) take precedence over gating failures (`3`).
263260| SARIF | ` --sarif ` | ` .cache/codeclone/report.sarif ` |
264261| Text | ` --text ` | ` .cache/codeclone/report.txt ` |
265262
266- All report formats are rendered from one canonical JSON report document.
267-
268- - ` --open-html-report ` opens the generated HTML report in the default browser and requires ` --html ` .
269- - ` --timestamped-report-paths ` appends a UTC timestamp to default report filenames for bare report flags such as
270- ` --html ` or ` --json ` . Explicit report paths are not rewritten.
271-
272- The docs site also includes live example HTML/JSON/SARIF reports generated from the current ` codeclone ` repository.
273-
274- Structural findings include:
275-
276- - ` duplicated_branches `
277- - ` clone_guard_exit_divergence `
278- - ` clone_cohort_drift `
279-
280- ### Inline Suppressions
281-
282- CodeClone keeps dead-code detection deterministic and static by default. When a symbol is intentionally
283- invoked through runtime dynamics (for example framework callbacks, plugin loading, or reflection), suppress
284- the known false positive explicitly at the declaration site:
263+ All formats are rendered from one canonical JSON report.
264+ ` --open-html-report ` opens the HTML in the default browser.
265+ ` --timestamped-report-paths ` appends a UTC timestamp to default filenames.
285266
286- ``` python
287- # codeclone: ignore[dead-code]
288- def handle_exception (exc : Exception ) -> None :
289- ...
290-
291-
292- class Middleware : # codeclone: ignore[dead-code]
293- ...
294- ```
295-
296- Dynamic/runtime false positives are resolved via explicit inline suppressions, not via broad heuristics.
267+ Report contract: [ Report contract] ( https://orenlab.github.io/codeclone/book/08-report/ ) ·
268+ [ HTML render] ( https://orenlab.github.io/codeclone/book/10-html-render/ )
297269
298270<details >
299271<summary >Canonical JSON report shape (v2.8)</summary >
@@ -410,11 +382,29 @@ Dynamic/runtime false positives are resolved via explicit inline suppressions, n
410382}
411383```
412384
413- Canonical contract: [ Report contract] ( https://orenlab.github.io/codeclone/book/08-report/ ) and
414- [ Dead-code contract] ( https://orenlab.github.io/codeclone/book/16-dead-code-contract/ )
385+ Full contract: [ Report contract] ( https://orenlab.github.io/codeclone/book/08-report/ )
415386
416387</details >
417388
389+ ## Inline Suppressions
390+
391+ When a symbol is invoked through runtime dynamics (framework callbacks, plugin loading, reflection),
392+ suppress the known false positive at the declaration site:
393+
394+ ``` python
395+ # codeclone: ignore[dead-code]
396+ def handle_exception (exc : Exception ) -> None :
397+ ...
398+
399+
400+ class Middleware : # codeclone: ignore[dead-code]
401+ ...
402+ ```
403+
404+ Suppression contract:
405+ [ Inline suppressions] ( https://orenlab.github.io/codeclone/book/19-inline-suppressions/ ) ·
406+ [ Dead-code contract] ( https://orenlab.github.io/codeclone/book/16-dead-code-contract/ )
407+
418408## How It Works
419409
4204101 . ** Parse** — Python source to AST
@@ -430,18 +420,14 @@ CFG semantics: [CFG semantics](https://orenlab.github.io/codeclone/cfg/)
430420
431421## Documentation
432422
433- | Topic | Link |
434- | ----------------------------| -----------------------------------------------------------------------------------------------------|
435- | Contract book (start here) | [ Contracts and guarantees] ( https://orenlab.github.io/codeclone/book/00-intro/ ) |
436- | Exit codes | [ Exit codes and failure policy] ( https://orenlab.github.io/codeclone/book/03-contracts-exit-codes/ ) |
437- | Configuration | [ Config and defaults] ( https://orenlab.github.io/codeclone/book/04-config-and-defaults/ ) |
438- | Baseline contract | [ Baseline contract] ( https://orenlab.github.io/codeclone/book/06-baseline/ ) |
439- | Cache contract | [ Cache contract] ( https://orenlab.github.io/codeclone/book/07-cache/ ) |
440- | Report contract | [ Report contract] ( https://orenlab.github.io/codeclone/book/08-report/ ) |
441- | Metrics & quality gates | [ Metrics and quality gates] ( https://orenlab.github.io/codeclone/book/15-metrics-and-quality-gates/ ) |
442- | Dead code | [ Dead-code contract] ( https://orenlab.github.io/codeclone/book/16-dead-code-contract/ ) |
443- | Docker benchmark contract | [ Benchmarking contract] ( https://orenlab.github.io/codeclone/book/18-benchmarking/ ) |
444- | Determinism | [ Determinism policy] ( https://orenlab.github.io/codeclone/book/12-determinism/ ) |
423+ Full docs and contract book: [ orenlab.github.io/codeclone] ( https://orenlab.github.io/codeclone/ )
424+
425+ Quick links:
426+ [ Baseline] ( https://orenlab.github.io/codeclone/book/06-baseline/ ) ·
427+ [ Report] ( https://orenlab.github.io/codeclone/book/08-report/ ) ·
428+ [ Metrics & gates] ( https://orenlab.github.io/codeclone/book/15-metrics-and-quality-gates/ ) ·
429+ [ MCP] ( https://orenlab.github.io/codeclone/book/20-mcp-interface/ ) ·
430+ [ CLI] ( https://orenlab.github.io/codeclone/book/09-cli/ )
445431
446432## Benchmarking Notes
447433
@@ -476,6 +462,7 @@ Versions released before this change remain under their original license terms.
476462
477463## Links
478464
465+ - ** Docs:** < https://orenlab.github.io/codeclone/ >
479466- ** Issues:** < https://github.com/orenlab/codeclone/issues >
480467- ** PyPI:** < https://pypi.org/project/codeclone/ >
481468- ** Licenses:** [ MPL-2.0] ( LICENSE ) · [ MIT docs] ( LICENSE-docs )
0 commit comments