Repository navigation
Clean up dead code and what the compiler and qmllint warn about - #428
Merged
Merged
Conversation
Found with a -Wall -Wextra (and more) build, qmllint, and the whole test suite under AddressSanitizer and UBSan (no memory errors or undefined behavior). Nothing here changes what the app does. - Dead code: the commandRequested signal (sent for unknown commands, heard by nothing), schema::pageRoles(), PosService::lowStock() (only a test used it), and two helpers never called (schema's options(QStringList), print's dropChars). - QML: a property named "state" (the network page's dots) and one named "count" (the check's seat row) hid an Item's and a ListView's own; renamed status and seatCount. Unused imports of QtQuick.Dialogs and QtQuick.Controls.Fusion taken out of 14 files. - Clearer: parentheses where && sits in || (a picture's name), a report loop's id that hid the report's, a stress-test count nobody read. - Tests: the update-by-itself test could send the update to the "busy" phone in the moment between connecting and logging in (seen under AddressSanitizer, which slows everything); it logs that phone in with the setting off. A /proc read checks the file opened; loops over string literals no longer copy each one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Weg3awu6SARK7jYrtvDfuw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A pass for dead code and bugs, using:
-Wall -Wextraand more (-Wshadow,-Wnull-dereference,-Wduplicated-cond,-Wlogical-op…);qmllinton all 101 QML files;No real bugs turned up. Nothing here changes what the app does.
Dead code removed
LayoutController::commandRequested: sent for unknown commands, heard by nothing.schema::pageRoles(): never called.PosService::lowStock(): only a test used it.options(QStringList)and print'sdropChars.QtQuick.Dialogs/QtQuick.Controls.Fusionimports in 14 QML files.QML properties that hid Qt's own
stateproperty (an Item's own); renamedstatus.count(a ListView's own); renamedseatCount, including two uses that would otherwise have switched to the list's built-in count.Clearer code
&&sits inside||(a picture's name).idthat hid the report's own.Tests
/procread now checks that the file opened, and loops over string literals no longer copy each one.Checked and left as they are
QPointerchecks,user() && …).tools/i18n.py stalelists include menu item names and layout descriptions it can't see, so none were deleted.The full suite passes (640 cases).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Weg3awu6SARK7jYrtvDfuw