Skip to content

fix: skip indexing and reporting for files located outside context root - #370

Merged
solid-illiaaihistov merged 1 commit into
solid-software:masterfrom
solid-illiaaihistov:fix/avoid-duplicate-code-context-root
Sep 1, 2026
Merged

fix: skip indexing and reporting for files located outside context root#370
solid-illiaaihistov merged 1 commit into
solid-software:masterfrom
solid-illiaaihistov:fix/avoid-duplicate-code-context-root

Conversation

@solid-illiaaihistov

@solid-illiaaihistov solid-illiaaihistov commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Prevented duplicate-code analysis from scanning files outside the configured analysis context.
    • Avoided false duplicate-code reports from out-of-scope files.
  • Tests

    • Added regression coverage to verify that files outside the analysis context are excluded from indexing and reporting.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a7afcb-0bdd-44af-96b2-248a0db1e3a1

📥 Commits

Reviewing files that changed from the base of the PR and between 2c51ddc and 619ea3b.

📒 Files selected for processing (2)
  • lib/src/lints/avoid_duplicate_code/visitors/avoid_duplicate_code_visitor.dart
  • test/src/lints/avoid_duplicate_code/avoid_duplicate_code_rule_test.dart

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The duplicate-code visitor now ignores files outside the configured analysis context root. A regression test confirms that such files are not indexed or reported.

Changes

Duplicate-code context filtering

Layer / File(s) Summary
Filter external files before duplicate analysis
lib/src/lints/avoid_duplicate_code/visitors/avoid_duplicate_code_visitor.dart, test/src/lints/avoid_duplicate_code/avoid_duplicate_code_rule_test.dart
The visitor uses PathUtils.isWithinOrEqual to skip files outside the context root. The regression test verifies that the global registry remains empty.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 619ea

The change limits duplicate-code analysis and reporting to files within the configured context root and adds regression coverage. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: files outside the context root are skipped during indexing and reporting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@solid-illiaaihistov
solid-illiaaihistov merged commit 459cb9b into solid-software:master Sep 1, 2026
2 checks passed
@solid-illiaaihistov
solid-illiaaihistov deleted the fix/avoid-duplicate-code-context-root branch September 1, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants