Skip to content

refactor: remove unused CompositeAnalyzer in favor of AllAnalyzersVerifier#1049

Merged
rjmurillo merged 2 commits intomainfrom
reconcile-composite-analyzer-530
Mar 8, 2026
Merged

refactor: remove unused CompositeAnalyzer in favor of AllAnalyzersVerifier#1049
rjmurillo merged 2 commits intomainfrom
reconcile-composite-analyzer-530

Conversation

@rjmurillo-bot
Copy link
Copy Markdown
Collaborator

@rjmurillo-bot rjmurillo-bot commented Mar 8, 2026

Summary

  • Removes CompositeAnalyzer and its entire project (Moq.Analyzers.Test.Analyzers), which was dead code not referenced by any test
  • Keeps AllAnalyzersVerifier, which is actively used by 4 test classes for false-positive verification
  • Both used reflection to discover all DiagnosticAnalyzer types, but only AllAnalyzersVerifier was wired into the test suite

Details

CompositeAnalyzer wrapped all analyzers into a single DiagnosticAnalyzer subclass. AllAnalyzersVerifier runs each analyzer individually through AnalyzerVerifier<T>. The latter approach gives better test isolation and diagnostic attribution. Since CompositeAnalyzer had zero usages, removing it is the correct reconciliation.

Files removed:

  • tests/Moq.Analyzers.Test.Analyzers/CompositeAnalyzer.cs
  • tests/Moq.Analyzers.Test.Analyzers/Moq.Analyzers.Test.Analyzers.csproj

Files modified:

  • Moq.Analyzers.sln (removed project entry and build configurations)
  • tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj (removed project reference)

Test plan

  • Solution builds with zero warnings and zero errors
  • All 2978 tests pass

Closes #530

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed test analyzer project from the solution structure and updated related project configurations to streamline the build setup.

…ifier

CompositeAnalyzer and AllAnalyzersVerifier both used reflection to discover
all DiagnosticAnalyzer types. CompositeAnalyzer was dead code, referenced
by no tests. AllAnalyzersVerifier is actively used by 4 test classes for
false-positive verification. Remove CompositeAnalyzer and its project.

Closes #530

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rjmurillo-bot rjmurillo-bot requested a review from rjmurillo as a code owner March 8, 2026 01:32
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8fc8fc28-76c4-4d0f-bffa-7c69111896a8

📥 Commits

Reviewing files that changed from the base of the PR and between 942999c and 667fa7d.

📒 Files selected for processing (5)
  • Moq.Analyzers.sln
  • build/targets/codeanalysis/CodeAnalysis.props
  • tests/Moq.Analyzers.Test.Analyzers/CompositeAnalyzer.cs
  • tests/Moq.Analyzers.Test.Analyzers/Moq.Analyzers.Test.Analyzers.csproj
  • tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj
💤 Files with no reviewable changes (4)
  • Moq.Analyzers.sln
  • tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj
  • tests/Moq.Analyzers.Test.Analyzers/CompositeAnalyzer.cs
  • tests/Moq.Analyzers.Test.Analyzers/Moq.Analyzers.Test.Analyzers.csproj

📝 Walkthrough

Walkthrough

This PR removes the Moq.Analyzers.Test.Analyzers test project and its CompositeAnalyzer implementation from the solution, consolidating diagnostic testing into the existing AllAnalyzersVerifier approach. Project references, build configurations, and solution nesting entries are updated accordingly.

Changes

Cohort / File(s) Summary
Solution and Build Configuration
Moq.Analyzers.sln, build/targets/codeanalysis/CodeAnalysis.props
Removed Moq.Analyzers.Test.Analyzers project entry, its configuration mappings in ProjectConfigurationPlatforms, and nested project references; updated conditional in CodeAnalysis.props to exclude the removed project from analyzer rule enforcement.
Test Analyzer Project Removal
tests/Moq.Analyzers.Test.Analyzers/CompositeAnalyzer.cs, tests/Moq.Analyzers.Test.Analyzers/Moq.Analyzers.Test.Analyzers.csproj
Deleted CompositeAnalyzer class that aggregated diagnostics via reflection-based analyzer discovery and removed the project file defining the test analyzer project configuration.
Test Project References
tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj
Removed ProjectReference to Moq.Analyzers.Test.Analyzers; test suite now relies solely on the main Moq.Analyzers reference.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • PR #342: Adds the Moq.Analyzers.Test.Analyzers project and CompositeAnalyzer that this PR removes.
  • PR #345: Modifies code within the Moq.Analyzers.Test.Analyzers project that is being deleted in this PR.

Suggested labels

housekeeping, analyzers, build

Suggested reviewers

  • MattKotsenas
  • rjmurillo
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: removing the unused CompositeAnalyzer and replacing its functionality with the existing AllAnalyzersVerifier.
Description check ✅ Passed The PR description provides comprehensive details covering motivation, specific files affected, test validation, and issue closure. It aligns well with the template structure.
Linked Issues check ✅ Passed The PR successfully addresses all requirements from issue #530: removes the unused CompositeAnalyzer, retains the actively-used AllAnalyzersVerifier, and provides better test isolation through per-analyzer execution.
Out of Scope Changes check ✅ Passed All changes are directly related to removing CompositeAnalyzer and its project. Modifications include solution file updates, project reference removals, and build configuration adjustments—all in scope of the stated objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch reconcile-composite-analyzer-530

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

@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Mar 8, 2026

DeepSource Code Review

We reviewed changes in 942999c...667fa7d on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Mar 8, 2026 6:07p.m. Review ↗

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Mar 8, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.12% (target: -1.00%) (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3b5ac71) 2537 2288 90.19%
Head commit (667fa7d) 2465 (-72) 2220 (-68) 90.06% (-0.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1049) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@rjmurillo rjmurillo changed the title Remove unused CompositeAnalyzer in favor of AllAnalyzersVerifier refactor: remove unused CompositeAnalyzer in favor of AllAnalyzersVerifier Mar 8, 2026
Remove stale reference to deleted Moq.Analyzers.Test.Analyzers project
from CodeAnalysis.props condition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai coderabbitai bot requested a review from MattKotsenas March 8, 2026 18:08
@coderabbitai coderabbitai bot added housekeeping analyzers Change that impacts an analyzer behavior build labels Mar 8, 2026
@rjmurillo rjmurillo merged commit 1520bae into main Mar 8, 2026
47 checks passed
@rjmurillo rjmurillo deleted the reconcile-composite-analyzer-530 branch March 8, 2026 21:41
@rjmurillo rjmurillo added this to the vNext milestone Mar 8, 2026
rjmurillo added a commit that referenced this pull request Mar 8, 2026
…ifier (#1049)

## Summary
- Removes `CompositeAnalyzer` and its entire project
(`Moq.Analyzers.Test.Analyzers`), which was dead code not referenced by
any test
- Keeps `AllAnalyzersVerifier`, which is actively used by 4 test classes
for false-positive verification
- Both used reflection to discover all `DiagnosticAnalyzer` types, but
only `AllAnalyzersVerifier` was wired into the test suite

## Details
`CompositeAnalyzer` wrapped all analyzers into a single
`DiagnosticAnalyzer` subclass. `AllAnalyzersVerifier` runs each analyzer
individually through `AnalyzerVerifier<T>`. The latter approach gives
better test isolation and diagnostic attribution. Since
`CompositeAnalyzer` had zero usages, removing it is the correct
reconciliation.

**Files removed:**
- `tests/Moq.Analyzers.Test.Analyzers/CompositeAnalyzer.cs`
-
`tests/Moq.Analyzers.Test.Analyzers/Moq.Analyzers.Test.Analyzers.csproj`

**Files modified:**
- `Moq.Analyzers.sln` (removed project entry and build configurations)
- `tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj` (removed project
reference)

## Test plan
- [x] Solution builds with zero warnings and zero errors
- [x] All 2978 tests pass

Closes #530

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Removed test analyzer project from the solution structure and updated
related project configurations to streamline the build setup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Richard Murillo <rjmurillo@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
rjmurillo added a commit that referenced this pull request Mar 8, 2026
…ifier (#1049)

## Summary
- Removes `CompositeAnalyzer` and its entire project
(`Moq.Analyzers.Test.Analyzers`), which was dead code not referenced by
any test
- Keeps `AllAnalyzersVerifier`, which is actively used by 4 test classes
for false-positive verification
- Both used reflection to discover all `DiagnosticAnalyzer` types, but
only `AllAnalyzersVerifier` was wired into the test suite

## Details
`CompositeAnalyzer` wrapped all analyzers into a single
`DiagnosticAnalyzer` subclass. `AllAnalyzersVerifier` runs each analyzer
individually through `AnalyzerVerifier<T>`. The latter approach gives
better test isolation and diagnostic attribution. Since
`CompositeAnalyzer` had zero usages, removing it is the correct
reconciliation.

**Files removed:**
- `tests/Moq.Analyzers.Test.Analyzers/CompositeAnalyzer.cs`
-
`tests/Moq.Analyzers.Test.Analyzers/Moq.Analyzers.Test.Analyzers.csproj`

**Files modified:**
- `Moq.Analyzers.sln` (removed project entry and build configurations)
- `tests/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj` (removed project
reference)

## Test plan
- [x] Solution builds with zero warnings and zero errors
- [x] All 2978 tests pass

Closes #530

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Removed test analyzer project from the solution structure and updated
related project configurations to streamline the build setup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Richard Murillo <rjmurillo@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyzers Change that impacts an analyzer behavior build housekeeping releasable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconcile AllAnalyzersVerifier and CompositeAnalyzer

2 participants