Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
perf: add Moq1208 benchmarks for issue #777 completion #1089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
perf: add Moq1208 benchmarks for issue #777 completion #1089
Changes from all commits
5e6ca78e2eb3476d4a2982399ec4d8851894fdcb33de0809f2097999dd0251fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check warning on line 1 in tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs
tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs#L1
Check notice on line 3 in tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs
tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs#L3
Check notice on line 15 in tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs
tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs#L15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add XML documentation for the public benchmark API surface.
This file introduces public members without XML docs (
Moq1208ReturnsDelegateBenchmarks,FileCount,MoqKey,SetupCompilation,Moq1208WithDiagnostics,Moq1208Baseline).As per coding guidelines,
**/*.cs: "Ensure all public APIs have complete XML documentation".Also applies to: 28-28, 66-66, 83-83
🧰 Tools
🪛 GitHub Check: Codacy Static Code Analysis
[notice] 15-15: tests/Moq.Analyzers.Benchmarks/Moq1208ReturnsDelegateBenchmarks.cs#L15
Assign this magic number '1000' to a well-named variable or constant, and use that instead.
🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace null-forgiving dereferences with explicit setup guards.
Line 69 and Line 86 assume setup always ran; if not, benchmark failures degrade to opaque NREs. Add explicit state checks before analysis calls.
💡 Suggested change
[Benchmark] public async Task Moq1208WithDiagnostics() { + if (TestCompilation is null) + { + throw new InvalidOperationException($"{nameof(SetupCompilation)} must run before {nameof(Moq1208WithDiagnostics)}."); + } + ImmutableArray<Diagnostic> diagnostics = - (await TestCompilation! + (await TestCompilation .GetAnalysisResultAsync(CancellationToken.None) .ConfigureAwait(false)) .AssertValidAnalysisResult() .GetAllDiagnostics(); @@ [Benchmark(Baseline = true)] public async Task Moq1208Baseline() { + if (BaselineCompilation is null) + { + throw new InvalidOperationException($"{nameof(SetupCompilation)} must run before {nameof(Moq1208Baseline)}."); + } + ImmutableArray<Diagnostic> diagnostics = - (await BaselineCompilation! + (await BaselineCompilation .GetAnalysisResultAsync(CancellationToken.None) .ConfigureAwait(false)) .AssertValidAnalysisResult() .GetAllDiagnostics();Also applies to: 86-87
🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found 22 lines of similar code in 2 locations (mass = 74) [qlty:similar-code]
Uh oh!
There was an error while loading. Please reload this page.