Skip to content

refactor(sonar): reduce code duplication#268

Merged
ReenigneArcher merged 2 commits into
masterfrom
refactor/sonar/reduce-code-duplication
Jun 10, 2026
Merged

refactor(sonar): reduce code duplication#268
ReenigneArcher merged 2 commits into
masterfrom
refactor/sonar/reduce-code-duplication

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Remove code duplication reported by sonar.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@ReenigneArcher ReenigneArcher added this to the sonar milestone Jun 10, 2026
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.91%. Comparing base (2d848cf) to head (86d6dea).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #268   +/-   ##
=======================================
  Coverage   92.91%   92.91%           
=======================================
  Files          35       35           
  Lines        2357     2357           
  Branches     1116     1115    -1     
=======================================
  Hits         2190     2190           
+ Misses         76       50   -26     
- Partials       91      117   +26     
Flag Coverage Δ
Linux 91.89% <ø> (ø)
Windows-AMD64 91.32% <ø> (ø)
Windows-ARM64 66.86% <ø> (ø)
macOS 74.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d848cf...86d6dea. Read the comment docs.

@ReenigneArcher ReenigneArcher force-pushed the refactor/sonar/reduce-code-duplication branch from b836fc4 to 440d427 Compare June 10, 2026 03:15
Move and simplify several test helper functions out of the test fixture, change primary-device helper to accept std::string_view, and add a makePamWithSharedMode helper. Add missing includes (<string_view> and <format>) and replace string concatenation with std::format for friend/display names. Use 'using enum display_device::HdrState' to shorten enum usages and update related expectations. Also mark expectedFallbackTopologyEvaluationCalls as const and adjust some local variable types to match the new helpers.
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher merged commit 7f853ed into master Jun 10, 2026
22 checks passed
@ReenigneArcher ReenigneArcher deleted the refactor/sonar/reduce-code-duplication branch June 10, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant