STYLE: Remove unused non-trivial variables (clazy unused-non-trivial-variable)#1374
Conversation
|
@jamesobutler A little cleanup while getting Qt6 support fortified. |
|
@jamesobutler — good catch. The TODO documents that I've opened #1380 to track moving it to the |
|
Could you rebase this branch instead to pull out the merge commit and allow the commit message check to pass? |
…variable) Remove unused Qt value-type variables (QString, QDir, QStringList, QVariant, QMap, QList) detected by clazy. Most were dead code from debugging or refactoring. Also fix a bug in ctkDICOMDatabase::cleanup() where tagcacheCleanup was created for the TagCacheDatabase but seriesCleanup was mistakenly called instead, so the tag cache was never VACUUM'd. Issue created for tracking commented out variable that needs to be moved. commontk#1380 AI tools used to identify and fix these warnings
dcec32a to
524e729
Compare
|
From my user role, I unfortunately don’t have the options in settings for this repo to make those changes. |
| seriesCleanup.exec("VACUUM;"); | ||
| QSqlQuery tagcacheCleanup(d->TagCacheDatabase); | ||
| seriesCleanup.exec("VACUUM;"); | ||
| tagcacheCleanup.exec("VACUUM;"); |
There was a problem hiding this comment.
Nice catch! I noticed the lack of cleaning up of tagcache file but never had the time to investigate.


Cherry-picked from #1372, part of a systematic clazy static analysis effort to improve CTK for Slicer compatibility and Qt6 migration.
What this changes
Removes local variables of non-trivial Qt types (
QStringList,QList, etc.) that are declared but never read or used. These trigger constructors and destructors with no effect — dead code flagged by the clazyunused-non-trivial-variablecheck.Why
Dead code — these objects are constructed and destroyed without being read or used. Removing them reduces noise and slightly reduces binary size.
Testing
🤖 Identified via clazy static analysis using CTK-claude-skills