Skip to content

Comments

[Infra] Suppress code analysis warnings#6905

Merged
Kielek merged 2 commits intoopen-telemetry:mainfrom
martincostello:suppress-analyzer-warnings
Feb 18, 2026
Merged

[Infra] Suppress code analysis warnings#6905
Kielek merged 2 commits intoopen-telemetry:mainfrom
martincostello:suppress-analyzer-warnings

Conversation

@martincostello
Copy link
Member

Changes

Suppress code analysis warnings I found from building the whole solution locally in Visual Studio 2026.

Also applies some code formatting/refactoring suggestions in files I had to touch.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Suppress code analysis warnings I found from building the whole solution locally in Visual Studio 2026.

Also applies some code formatting/refactoring suggestions in files I had to touch.
Copilot AI review requested due to automatic review settings February 17, 2026 14:25
@martincostello martincostello requested a review from a team as a code owner February 17, 2026 14:25
@github-actions github-actions bot added documentation Documentation related infra Infra work - CI/CD, code coverage, linters pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package perf Performance related pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package labels Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.36%. Comparing base (86c7a90) to head (a2688fd).
⚠️ Report is 14 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main    #6905    +/-   ##
========================================
  Coverage   86.35%   86.36%            
========================================
  Files         263      263            
  Lines       12387    12563   +176     
========================================
+ Hits        10697    10850   +153     
- Misses       1690     1713    +23     
Flag Coverage Δ
unittests-Project-Experimental 86.02% <100.00%> (-0.24%) ⬇️
unittests-Project-Stable 86.25% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs 89.71% <100.00%> (-0.10%) ⬇️

... and 9 files with indirect coverage changes

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses code analysis warnings found when building the solution in Visual Studio (described as "Visual Studio 2026" which appears to be a typo). The changes include suppressing specific CA warnings (CA1873, CA2025) and applying modern C# syntax refactorings such as collection expressions and expression-bodied members.

Changes:

  • Added CA1873 warning suppression for potentially expensive logging in test and doc projects
  • Refactored code to use modern C# syntax: collection expressions ([]), expression-bodied members, and field keyword for semi-auto properties
  • Added CA2025 warning suppression in ZipkinExporter for intentional blocking HTTP call pattern

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/OpenTelemetry.Tests/Logs/LogRecordTests.cs Adds CA1873 suppression; refactors to use collection expressions, expression-bodied members, and field keyword
test/Benchmarks/Logs/LogBenchmarks.cs Refactors benchmark methods to expression-bodied syntax; adds CA1873 suppression; contains invalid empty class syntax
src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs Adds CA2025 suppression for synchronous HTTP call; converts method to expression-bodied syntax
docs/Directory.Build.props Adds CA1873 to NoWarn list for documentation projects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move suppression from `Directory.Build.props` to `extending-the-sdk.csproj`.
@github-actions github-actions bot removed the infra Infra work - CI/CD, code coverage, linters label Feb 18, 2026
@Kielek Kielek enabled auto-merge February 18, 2026 09:58
@Kielek Kielek added this pull request to the merge queue Feb 18, 2026
Merged via the queue into open-telemetry:main with commit 5093c17 Feb 18, 2026
59 checks passed
@martincostello martincostello deleted the suppress-analyzer-warnings branch February 18, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation related perf Performance related pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants