Skip to content

Fix constant condition CodeQL warnings#355

Merged
martincostello merged 1 commit intomainfrom
fix-codeql-warnings
Nov 24, 2025
Merged

Fix constant condition CodeQL warnings#355
martincostello merged 1 commit intomainfrom
fix-codeql-warnings

Conversation

@martincostello
Copy link
Copy Markdown
Member

Changes

Remove redundant if blocks to resolve CodeQL warnings about constant conditions.

Merge requirement checklist

  • Unit tests added/updated
  • CHANGELOG.md updated
  • Changes in public API reviewed (if applicable)

Remove redundant `if` blocks to resolve CodeQL warnings about constant conditions.
@martincostello martincostello requested a review from a team as a code owner November 24, 2025 10:45
Copilot AI review requested due to automatic review settings November 24, 2025 10:45
@martincostello martincostello added the enhancement New feature or request label Nov 24, 2025
@martincostello martincostello enabled auto-merge (squash) November 24, 2025 10:45
Copy link
Copy Markdown

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 removes redundant null checks in three extension methods that were causing CodeQL warnings about constant conditions. The changes simplify the code by removing unnecessary if blocks that checked for null before using the null-conditional operator ?..

  • Removes redundant if (configure != null) checks before configure?.Invoke(settings) calls
  • Applies the same fix consistently across three provider builder extensions
  • No behavioral changes, as the null-conditional operator already handles null checking

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
TracerProviderBuilderExtensions.cs Removed redundant null check before invoking the configure callback in UseGrafana method
OpenTelemetryLoggerOptionsExtensions.cs Removed redundant null check before invoking the configure callback in UseGrafana method
MeterProviderBuilderExtensions.cs Removed redundant null check before invoking the configure callback in UseGrafana method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants