fix: remediate clang-tidy violations batch 8 — lower threshold to 175#234
fix: remediate clang-tidy violations batch 8 — lower threshold to 175#234
Conversation
- misc-const-correctness: add const to 20+ variables across 14 files (headers counted multiple times across TUs) - bugprone-unchecked-optional-access: guard optional access in serializer - readability-implicit-bool-conversion: explicit != 0U in CRC check - misc-include-cleaner: add missing e2e_profile.h include - cppcoreguidelines-avoid-do-while: convert EINTR retry loops to while Lowers baseline threshold from 384 to 175.
📝 WalkthroughWalkthroughThis PR applies const-correctness improvements across 15 files, making local variables immutable where appropriate. Additionally, UDP transport retry logic is refactored from do-while to conditional while patterns, and DeserializationResult now explicitly aborts when accessing unset values. The clang-tidy baseline metric decreases from 384 to 175. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@include/serialization/serializer.h`:
- Around line 80-95: The change from throwing std::bad_optional_access to
calling std::abort() in get_value() and move_value() is a breaking API change
for external consumers; revert to the previous exception behavior (throw
std::bad_optional_access when value_ is empty) or, if abort-like behavior is
desired only in debug builds, replace the unconditional std::abort() with a
debug-only assertion (e.g., assert(value_.has_value())) and throw
std::bad_optional_access in release builds; update the public API
contract/comments on get_value() and move_value() to document the chosen
behavior so downstream users know whether they must handle exceptions or if the
call is fatal.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e66d89cd-97a4-4ee5-8dd8-e4f585978ee2
📒 Files selected for processing (16)
clang-tidy-baseline.txtinclude/platform/posix/net_impl.hinclude/serialization/serializer.hinclude/someip/message.hsrc/e2e/e2e_crc.cppsrc/e2e/e2e_profile_registry.cppsrc/events/event_subscriber.cppsrc/rpc/rpc_client.cppsrc/rpc/rpc_server.cppsrc/sd/sd_client.cppsrc/sd/sd_message.cppsrc/serialization/serializer.cppsrc/someip/message.cppsrc/tp/tp_reassembler.cppsrc/transport/tcp_transport.cppsrc/transport/udp_transport.cpp
Summary
constto 20+ variables across 14 files (headers likemessage.handnet_impl.hare counted multiple times across translation units)DeserializationResult::get_value()/move_value()withhas_value()check!= 0Ucomparison in CRC bitmask checke2e/e2e_profile.hinclude forE2EProfilePtrThreshold lowered from 384 → 175 (estimated ~64 violations eliminated).
Test plan
Made with Cursor
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores
This release focuses on internal code quality improvements and robustness enhancements without introducing new user-facing features.