Skip to main content

Module diff_scope

Module diff_scope 

Source
Expand description

Diff line filters shared by every surface that accepts a unified diff.

The CLI (--diff-file, --diff-stdin and the CI diff) and the programmatic API (analysis.diffFile) narrow a report to the lines a change added. Both call the functions in this module, so a finding cannot pass the filter on one surface and fail it on another.

Functionsยง

filter_dead_code_by_diff
Drop the dead-code findings whose source line is not on an added line of the diff.
filter_duplication_by_diff
Keep only the clone groups with at least one instance whose line range overlaps an added line of the diff.