Sitelet https://github.com/NLog/NLog/pull/6190
Skip to content

SetupConfigurationTargetBuilder - Fix Sonar Code Smell - #6190

Merged
snakefoot merged 1 commit into
NLog:devfrom
snakefoot:SetupConfigurationTargetBuilder
May 24, 2026
Merged

snakefoot merged 1 commit into
NLog:devfrom
snakefoot:SetupConfigurationTargetBuilder

Conversation

@snakefoot

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented May 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1cb221f6-3764-44eb-8adf-e98e00d1ae42

📥 Commits

Reviewing files that changed from the base of the PR and between ec34b47 and cf67b76.

📒 Files selected for processing (1)
  • src/NLog/Internal/SetupConfigurationTargetBuilder.cs

Walkthrough

Private backing field _targets in SetupConfigurationTargetBuilder is renamed to _targetList. All explicit interface implementations for IList<Target>, ICollection<Target>, and IEnumerable are rewired to reference the renamed field across indexers, collection mutations, and enumeration operations.

Changes

Internal field refactoring

Layer / File(s) Summary
Field rename and interface rewiring
src/NLog/Internal/SetupConfigurationTargetBuilder.cs
Backing field _targets renamed to _targetList on line 44. All explicit interface members (indexers, Count, IsReadOnly, Add, Clear, Contains, CopyTo, Remove, RemoveAt, Insert, and GetEnumerator) rewired to operate on the renamed field across lines 73–128.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A field renamed with care and grace,
From _targets to _targetList's new place,
Interface members all rewired true,
No logic changed, just cleanup through and through!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a description explaining what Sonar code smell was identified and how the backing field rename resolves it.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the specific class (SetupConfigurationTargetBuilder) and indicates the change is fixing a Sonar code smell, which aligns with the internal refactoring of the backing field.
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.

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

✨ 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 and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@snakefoot
snakefoot merged commit 049738c into NLog:dev May 24, 2026
6 checks passed
@snakefoot snakefoot added this to the 6.1.4 milestone Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant