Cppcheck 2.20#4268
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR modernizes C++ usage across the codebase: swaps minimal ROOT includes for ChangesC++ Modernization and Cleanup
Possibly related PRs:
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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
offline/QA/SimulationModules/QAG4SimulationKFParticle.cc (1)
79-79:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCritical bug: checking wrong variable in error path.
Line 79 checks
!m_trackMapbut should check!m_truthInfo. Them_truthInfopointer was just assigned at line 78, andm_trackMapwas already validated at lines 72-76. This causes incorrect error reporting and prevents proper validation of the G4TruthInfo node.🐛 Proposed fix
m_truthInfo = findNode::getClass<PHG4TruthInfoContainer>(topNode, "G4TruthInfo"); - if (!m_trackMap) + if (!m_truthInfo) { std::cout << __PRETTY_FUNCTION__ << " Fatal Error : missing G4TruthInfo" << std::endl; return Fun4AllReturnCodes::ABORTRUN;
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0797d61c-6193-41bd-9fe7-05e5f446712d
📒 Files selected for processing (7)
calibrations/calorimeter/calo_tower_slope/LiteCaloEval.cccalibrations/framework/fun4cal/Fun4CalServer.ccoffline/QA/SimulationModules/QAG4SimulationKFParticle.ccoffline/framework/fun4all/Fun4AllHistoManager.ccoffline/framework/fun4allraw/mvtx_decoder/GBTLink.hoffline/framework/fun4allraw/mvtx_decoder/GBTWord.hoffline/framework/fun4allraw/mvtx_decoder/PixelData.h
…mat by std::format
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
offline/packages/trackreco/PHSimpleKFProp.cc (1)
52-57:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd the required
<bit>header forstd::bit_cast.
std::bit_castat line 916 is used without the<bit>include, which will fail on stricter/non-transitive builds. The header is missing from the standard library includes at lines 52–57.Proposed fix
`#include` <cmath> +#include <bit> `#include` <filesystem> `#include` <iostream> `#include` <syncstream> `#include` <vector>
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2c672798-02c8-47fd-82c2-f1746db0b791
📒 Files selected for processing (12)
offline/framework/fun4allraw/mvtx_decoder/GBTWord.hoffline/framework/fun4allraw/mvtx_decoder/PixelData.hoffline/packages/CaloReco/CaloTowerStatus.ccoffline/packages/CaloReco/ClusterCDFCalculator.ccoffline/packages/jetbase/JetProbeMaker.ccoffline/packages/jetbase/JetProbeMaker.hoffline/packages/trackbase/MvtxEventInfov2.ccoffline/packages/trackbase/MvtxEventInfov2.hoffline/packages/trackreco/PHSimpleKFProp.ccoffline/packages/trackreco/PHTrackPruner.ccsimulation/g4simulation/g4gdml/PHG4GDMLWrite.ccsimulation/g4simulation/g4main/PHG4ProcessMap.cc
💤 Files with no reviewable changes (1)
- offline/packages/trackbase/MvtxEventInfov2.cc
✅ Files skipped from review due to trivial changes (5)
- offline/packages/jetbase/JetProbeMaker.h
- offline/packages/trackreco/PHTrackPruner.cc
- offline/packages/CaloReco/CaloTowerStatus.cc
- simulation/g4simulation/g4gdml/PHG4GDMLWrite.cc
- simulation/g4simulation/g4main/PHG4ProcessMap.cc
🚧 Files skipped from review as they are similar to previous changes (1)
- offline/framework/fun4allraw/mvtx_decoder/PixelData.h
Build & test reportReport for commit e3be83949f9af91f12fe0dd878c3db838ba392a4:
Automatically generated by sPHENIX Jenkins continuous integration |
Build & test reportReport for commit ccda0f6ebb2aea7e38355a162d7ae24543b5270b:
Automatically generated by sPHENIX Jenkins continuous integration |
Build & test reportReport for commit 9fbf5e37b658f86de3704f5423b508d0aef0cef3:
Automatically generated by sPHENIX Jenkins continuous integration |
|
the valgrind error is from a cdb failure (not from this PR but in general not good, let's see if this happens more frequently) |
b4822c3
into
sPHENIX-Collaboration:master




Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
This PR fixes the warnings from the new cppcheck version before we switch
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
Summary
This PR applies targeted fixes across the codebase to address warnings raised by cppcheck 2.20 and to modernize some C++ usage. Changes are intended as non-breaking quality/maintenance fixes (casts, formatting, small refactors, safer initializations) rather than new features or algorithmic changes.
Motivation / context
Prepare the repository for adoption of cppcheck 2.20 and reduce static-analysis noise by correcting or silencing flagged issues. The edits adopt safer, well-defined C++ idioms (C++20 where used) and improve code clarity for future maintenance.
Key changes
Potential risk areas
Suggested follow-ups / possible future improvements
Note: This summary was produced with AI assistance. While file-level patterns and risks are reported based on the provided diffs and repository listing, automated analysis can make mistakes—please validate changes in code review (especially zero-initialization and bit-cast/reinterpretation areas).