From da7bbf0c069732dc8c057cc882269161e1218e0b Mon Sep 17 00:00:00 2001 From: K-Sai-Sujith Date: Thu, 19 Mar 2026 22:22:27 +0530 Subject: [PATCH 1/2] docs: document --min-coverage filter option (#4845) Adds comprehensive documentation for the --min-coverage CLI option including: - Detailed explanation of coverage calculation - Multiple use cases with command examples - Before/after output comparison - Performance characteristics --- docs/source/cli-reference/scan-options.rst | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 docs/source/cli-reference/scan-options.rst diff --git a/docs/source/cli-reference/scan-options.rst b/docs/source/cli-reference/scan-options.rst new file mode 100644 index 0000000000..e87897c63c --- /dev/null +++ b/docs/source/cli-reference/scan-options.rst @@ -0,0 +1,61 @@ +Scan Options +============ + +.. _scan_options_min_coverage: + +--min-coverage COVERAGE, -C COVERAGE +------------------------------------ + +**Purpose:** A quality filter used to filter license/copyright detection matches. + +**Syntax:** + ``--min-coverage 60`` + ``scancode -C 80 /path/to/code`` + +This filter limits the license and copyright detections by only reporting detections +on reference rules that contain at least `COVERAGE%` of the reference text as found +in that rule. + +**How the filter works:** +Every rule includes a reference text (for example, 500 characters) so, if the match +found was 300 characters, this would represent a 'coverage' of 60%. + +``--min-coverage 60`` = **INCLUDED** + +``--min-coverage 70`` = **EXCLUDED** (300/500 = 60% < 70%) + +**Default:** ``0`` (reports all matches regardless of coverage) +**Valid range:** ``0-100`` + +**Use Cases:** + +**1. Reduce "Noise" (Recommended)** + ``scancode --license --copyright --min-coverage 70 ./src/`` + + Limits false positives while maintaining high-confidence detections. + +**2. Strict analysis** + ``scancode --license --min-coverage 85 ./proprietary/`` + + Only highest confidence license matches for legal review. + +**3. Debugging all matches** + ``scancode --license --min-coverage 0 ./src/`` + + Shows everything (default behavior). + +**Output Comparison:** + +**No Filter (noisy):** +:: + license mit 45% 23/51 ./file.js + license mit 28% 14/51 ./file.js + license apache-2.0 12% 8/67 ./file.js + +**With --min-coverage 70 (clean):** +:: + license mit 85% 43/51 ./file.js + +**Pro tip:** Start with ``70%`` and adjust based on false positive rate. + +**Performance:** Minimal overhead - filtering occurs post-detection. From 9a545d1d6c6bef9878f397c31eb20eeb8f647643 Mon Sep 17 00:00:00 2001 From: Sujith Date: Sat, 21 Mar 2026 02:11:07 +0530 Subject: [PATCH 2/2] Add DCO sign off for PR 4851 Signed-off-by: K-Sai-Sujith Signed-off-by: Sujith --- docs/source/cli-reference/scan-options.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/cli-reference/scan-options.rst b/docs/source/cli-reference/scan-options.rst index e87897c63c..7bcb4dccda 100644 --- a/docs/source/cli-reference/scan-options.rst +++ b/docs/source/cli-reference/scan-options.rst @@ -1,4 +1,4 @@ -Scan Options +Scan Options ============ .. _scan_options_min_coverage: