Skip to content

[CODE HEALTH] Fix cland-tidy misc-no-recursion warnings#4009

Draft
marcalff wants to merge 4 commits intoopen-telemetry:mainfrom
marcalff:tidy_recursive
Draft

[CODE HEALTH] Fix cland-tidy misc-no-recursion warnings#4009
marcalff wants to merge 4 commits intoopen-telemetry:mainfrom
marcalff:tidy_recursive

Conversation

@marcalff
Copy link
Copy Markdown
Member

@marcalff marcalff commented Apr 16, 2026

Contributes to #2053

Changes

Fixed the following clang-tidy warnings:


opentelemetry-cpp/sdk/src/metrics/data/circular_buffer.cc (1 warnings)

Line Check Message
84 misc-no-recursion function 'Increment' is within a recursive call chain

Method AdaptingIntegerArray::Increment was using terminal recursion:

  • replaced the terminal recursive call with a loop
  • then unrolled the loop to 2 calls, since EnlargeToFit expands the storage to the proper size.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.31%. Comparing base (0962d71) to head (0329634).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4009      +/-   ##
==========================================
- Coverage   90.32%   90.31%   -0.01%     
==========================================
  Files         230      230              
  Lines        7299     7300       +1     
==========================================
  Hits         6592     6592              
- Misses        707      708       +1     
Files with missing lines Coverage Δ
sdk/src/metrics/data/circular_buffer.cc 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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