Skip to content

[DPG] Fix unused variables, parameters, values - #18639

Open
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:clang-tidy-unused-DPG
Open

vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:clang-tidy-unused-DPG

Conversation

@vkucera

@vkucera vkucera commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Fixes errors from the following Clang-Tidy categories:

  • clang-analyzer-deadcode.DeadStores
  • clang-diagnostic-unused-parameter
  • clang-diagnostic-unused-variable

Most errors are fixed temporarily by commenting out the unused bits and by adding a FIXME: unused comment.

The final fix is to either remove the unused bits or to fix the bugs which has to be done by someone who knows the intended behaviour.

Fixes errors from the following Clang-Tidy categories:

- `clang-analyzer-deadcode.DeadStores`
- `clang-diagnostic-unused-parameter`
- `clang-diagnostic-unused-variable`

Most errors are fixed temporarily by commenting out the unused bits and by adding a `FIXME: unused` comment.

The final fix is to either remove the unused bits or to fix the bugs which has to be done by someone who knows the intended behaviour.
@github-actions github-actions Bot added the dpg label Nov 7, 2026
@github-actions github-actions Bot changed the title Fix unused variables, parameters, values [DPG] Fix unused variables, parameters, values Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 57 warnings, 🔕 0 disabled

@vkucera
vkucera marked this pull request as ready for review November 7, 2026 18:05
@alibuild

alibuild commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 0083d29 at 2026-11-07 19:14:

## sw/BUILD/O2-latest/log
CMake Error at dependencies/FindFairRoot.cmake:68 (set_target_properties):
CMake Error at /sw/slc9_x86-64/CMake/v4.1.4-6/share/cmake-4.1/Modules/FeatureSummary.cmake:499 (message):

Full log here.

@alibuild

alibuild commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 0083d29 at 2026-11-07 19:15:

## sw/BUILD/O2-latest/log
CMake Error at dependencies/FindFairRoot.cmake:68 (set_target_properties):
CMake Error at /sw/slc9_x86-64/CMake/v4.1.4-6/share/cmake-4.1/Modules/FeatureSummary.cmake:499 (message):

Full log here.

@alibuild

alibuild commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 0083d29 at 2026-11-08 00:13:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 1 errors and 100 warnings.'
Found 1 errors and 100 warnings.
++ [[ 1 -gt 0 ]]
++ cat /sw/BUILD/8447195cf44670b7d8d351eeb27ccc80dc2ce394/O2Physics-code-check/errors.txt
DPG/Tasks/AOTTrack/qaEfficiency.cxx:1044:26: error: logical expression is always true [misc-redundant-expression,-warnings-as-errors]
++ [[ 100 -gt 0 ]]
++ cat /sw/BUILD/8447195cf44670b7d8d351eeb27ccc80dc2ce394/O2Physics-code-check/warnings.txt
DPG/Tasks/AOTTrack/qaEfficiency.cxx:87:24: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:93:18: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:97:46: warning: variable 'hPtIts' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:98:46: warning: variable 'hPtTpc' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:99:46: warning: variable 'hPtItsTpc' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:100:46: warning: variable 'hPtItsTof' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:101:46: warning: variable 'hPtTpcTof' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:102:46: warning: variable 'hPtItsTpcTof' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:103:46: warning: variable 'hPtItsTpcTrdTof' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:104:46: warning: variable 'hPtItsTpcTrd' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:105:46: warning: variable 'hPtTrkItsTpc' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:106:46: warning: variable 'hPtGenerated' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:107:46: warning: variable 'hPtGeneratedRecoEv' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:110:46: warning: variable 'hPtItsPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:111:46: warning: variable 'hPtItsTpcPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:112:46: warning: variable 'hPtTrkItsTpcPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:113:46: warning: variable 'hDeltaPtVsPtTrkItsTpcPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:114:46: warning: variable 'hPtGenVsPtTrkItsTpcPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:115:46: warning: variable 'hPtGenVsPIDTrkItsTpcPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:116:46: warning: variable 'hPtItsTpcTofPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:117:46: warning: variable 'hPtTrkItsTpcTofPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:118:46: warning: variable 'hPtGeneratedPrm' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:119:46: warning: variable 'hPtGeneratedPrmRecoEv' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:122:46: warning: variable 'hPtItsTpcStr' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:123:46: warning: variable 'hPtTrkItsTpcStr' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:124:46: warning: variable 'hPtItsTpcTofStr' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:125:46: warning: variable 'hPtGeneratedStr' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:126:46: warning: variable 'hPtmotherGenerated' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:127:46: warning: variable 'hdecaylengthmother' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:130:46: warning: variable 'hPtItsTpcMat' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:131:46: warning: variable 'hPtTrkItsTpcMat' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:132:46: warning: variable 'hPtItsTpcTofMat' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DPG/Tasks/AOTTrack/qaEfficiency.cxx:133:46: warning: variable 'hPtGeneratedMat' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants