Skip to content

feat: show filtered clone count in reports and improve test coverage - #18

Merged
ericodx merged 10 commits into
mainfrom
improve-report-classification
Apr 6, 2026
Merged

feat: show filtered clone count in reports and improve test coverage#18
ericodx merged 10 commits into
mainfrom
improve-report-classification

Conversation

@ericodx

@ericodx ericodx commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Show how many clones were filtered by configuration (ignoreSameFile, ignoreStructural) in TextReporter and HtmlReporter, so users understand why "No clones detected" appears when filters are active
  • Fix integration test that depended on project's .swift-cpd.yml config file
  • Improve test coverage for UnifiedTokenMapper, CTokenizerScanner, and BehaviorSignatureExtractor

Type of Change

  • feat: A new feature has been added.
  • fix: A bug has been fixed.
  • test: Addition or correction of tests.
  • docs: Changes only to the documentation.
  • ci: Changes related to continuous integration and deployment scripts.
  • build: Changes that affect the build system or external dependencies.
  • chore: Other changes that do not fit into the previous categories.
  • revert: Reverts a previous commit.
  • perf: A code change that improves performance.
  • refactor: A code change that neither fixes a bug nor adds a feature.

Invariants Checklist

  • Detection is deterministic (same input → same output)
  • Source files are never modified (tool is read-only)
  • Source locations are accurate (file, line, column)
  • No false negatives introduced (previously detected clones are still detected)
  • Performance not degraded for large codebases
  • Swift 6 Strict Concurrency compatible
  • Pipeline stages remain stateless pure transformations

Pipeline Impact

Which stages are affected?

  • FileDiscovery
  • Tokenization
  • Normalization
  • Detection (Type 1 / Type 2 / Type 3 / Type 4)
  • Reporting
  • CLI / Configuration
  • Cache / Baseline
  • None

Testing

  • Unit tests added or updated
  • Tests use TokenFactory / TempFileHelper / AnalysisHelper where appropriate
  • Integration tests added or updated (if detection or pipeline logic changed)
  • Both positive cases (expected clones) and negative cases (false positives to avoid) covered
  • All tests pass locally (swift test)

@ericodx ericodx self-assigned this Apr 6, 2026
@ericodx ericodx changed the title Improve report classification feat: show filtered clone count in reports and improve test coverage Apr 6, 2026
@ericodx ericodx added feature New feature or request fix Something wasn't working. test Addition or correction of tests chore Tooling, configuration, and maintenance labels Apr 6, 2026
@ericodx
ericodx merged commit 3dab089 into main Apr 6, 2026
1 check passed
@ericodx
ericodx deleted the improve-report-classification branch April 6, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Tooling, configuration, and maintenance feature New feature or request fix Something wasn't working. test Addition or correction of tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant