Remove dead code - #11082
Conversation
Delete function definitions with no call sites. Each was verified across src, test, variants, lib and the device-ui checkout, and checked for virtual dispatch, function-pointer registration and platform ifdef guards. Removed: - MessageStore::addFromPacket and addFromString, superseded by tryAddFromPacket - GeoCoord rangeRadiansToMeters, distanceTo, bearingTo - Router::rawSend, declared virtual with no override and no caller - ContentHandler handleHotspot, handleFs, handleAdminSettings, handleAdminSettingsApply, handleDeleteFsContent and their commented route registrations, plus the now unreachable htmlDeleteDir and the handleUpdateFs declaration that had no definition - ContentHelper replaceAll - OnScreenKeyboardModule popup chain: showPopup, clearPopup, drawPopup, drawPopupOverlay and their state, unreachable since the frame based UI was replaced by baseUI - DebugRenderer drawDebugInfoTrampoline, drawDebugInfoSettingsTrampoline and the orphaned drawFrameSettings - NodeListRenderer calculateMaxScroll, drawColumns and a stale extern haveGlyphs declaration with no definition - UIRenderer::haveGlyphs, Screen::blink, NotificationRenderer::showKeyboardMessagePopupWithTitle, VirtualKeyboard::getInputText - InkHUD touchNavLeft, touchNavRight, Applet::getActiveNodeCount, ThreadedMessageApplet::saveMessagesToFlash - TwoButton::setHandlerUp, TwoButtonExtended setHandlerUp, setJoystickDownHandlers, setJoystickUpHandlers - CannedMessageModule LaunchRepeatDestination, isCharInputAllowed, hasMessages - TrafficManagementModule resetStats, recordRouterHopPreserved, saturatingIncrement - UnitConversions::MetersPerSecondToMilesPerHour - EncryptedStorage getSessionRemainingSeconds - BMI270Sensor::writeRegisters, GPS::hasFlow, FSCommon copyFile, SerialConsole consolePrintf, buzz playLongPressLeadUp, memGet displayPercentHeapFree Also corrects the InkHUD README, which documented addFromPacket as the live path for storing broadcasts and DMs.
⚡ Try this PR in the Web FlasherNote Building this pull request… the flash button, badges and supported-board |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR removes unused filesystem, message, console, GPS, rendering, input, HTTP, telemetry, and security helpers. It also introduces incremental buzzer lead-up playback, narrows message ingestion APIs, removes keyboard popup handling, and initializes device metadata with defaults. ChangesCore API and persistence cleanup
Device and domain utility cleanup
UI and interaction cleanup
HTTP handler cleanup
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/MessageStore.h`:
- Line 97: Update the declaration comment for MessageStore::tryAddFromPacket in
MessageStore.h to describe only incoming/outgoing packet handling, removing the
“or manual input” wording while leaving the method signature unchanged.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a564b56e-6a86-4c86-bd85-bf4c4262e3b7
📒 Files selected for processing (54)
src/FSCommon.cppsrc/FSCommon.hsrc/MessageStore.cppsrc/MessageStore.hsrc/SerialConsole.cppsrc/SerialConsole.hsrc/buzz/buzz.cppsrc/buzz/buzz.hsrc/gps/GPS.cppsrc/gps/GPS.hsrc/gps/GeoCoord.cppsrc/gps/GeoCoord.hsrc/graphics/Screen.cppsrc/graphics/Screen.hsrc/graphics/VirtualKeyboard.cppsrc/graphics/VirtualKeyboard.hsrc/graphics/draw/DebugRenderer.cppsrc/graphics/draw/DebugRenderer.hsrc/graphics/draw/NodeListRenderer.cppsrc/graphics/draw/NodeListRenderer.hsrc/graphics/draw/NotificationRenderer.cppsrc/graphics/draw/NotificationRenderer.hsrc/graphics/draw/UIRenderer.cppsrc/graphics/draw/UIRenderer.hsrc/graphics/niche/InkHUD/Applet.cppsrc/graphics/niche/InkHUD/Applet.hsrc/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cppsrc/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.hsrc/graphics/niche/InkHUD/InkHUD.cppsrc/graphics/niche/InkHUD/InkHUD.hsrc/graphics/niche/InkHUD/docs/README.mdsrc/graphics/niche/Inputs/TwoButton.cppsrc/graphics/niche/Inputs/TwoButton.hsrc/graphics/niche/Inputs/TwoButtonExtended.cppsrc/graphics/niche/Inputs/TwoButtonExtended.hsrc/memGet.cppsrc/mesh/Router.cppsrc/mesh/Router.hsrc/mesh/http/ContentHandler.cppsrc/mesh/http/ContentHandler.hsrc/mesh/http/ContentHelper.cppsrc/mesh/http/ContentHelper.hsrc/modules/CannedMessageModule.cppsrc/modules/CannedMessageModule.hsrc/modules/OnScreenKeyboardModule.cppsrc/modules/OnScreenKeyboardModule.hsrc/modules/Telemetry/UnitConversions.cppsrc/modules/Telemetry/UnitConversions.hsrc/modules/TrafficManagementModule.cppsrc/modules/TrafficManagementModule.hsrc/motion/BMI270Sensor.cppsrc/motion/BMI270Sensor.hsrc/security/EncryptedStorage.cppsrc/security/EncryptedStorage.h
💤 Files with no reviewable changes (52)
- src/graphics/VirtualKeyboard.h
- src/mesh/http/ContentHelper.cpp
- src/graphics/niche/Inputs/TwoButton.h
- src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h
- src/mesh/Router.h
- src/SerialConsole.h
- src/mesh/http/ContentHelper.h
- src/modules/TrafficManagementModule.h
- src/graphics/niche/Inputs/TwoButton.cpp
- src/buzz/buzz.h
- src/FSCommon.h
- src/motion/BMI270Sensor.h
- src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp
- src/graphics/draw/NodeListRenderer.h
- src/graphics/VirtualKeyboard.cpp
- src/gps/GPS.cpp
- src/graphics/niche/InkHUD/Applet.cpp
- src/modules/Telemetry/UnitConversions.h
- src/graphics/draw/UIRenderer.h
- src/graphics/draw/NotificationRenderer.h
- src/graphics/niche/InkHUD/InkHUD.cpp
- src/security/EncryptedStorage.cpp
- src/mesh/Router.cpp
- src/mesh/http/ContentHandler.h
- src/graphics/niche/Inputs/TwoButtonExtended.cpp
- src/graphics/Screen.h
- src/graphics/draw/DebugRenderer.h
- src/modules/TrafficManagementModule.cpp
- src/graphics/draw/UIRenderer.cpp
- src/FSCommon.cpp
- src/graphics/niche/InkHUD/Applet.h
- src/memGet.cpp
- src/gps/GeoCoord.h
- src/modules/OnScreenKeyboardModule.h
- src/SerialConsole.cpp
- src/graphics/niche/Inputs/TwoButtonExtended.h
- src/gps/GeoCoord.cpp
- src/graphics/draw/NodeListRenderer.cpp
- src/MessageStore.cpp
- src/buzz/buzz.cpp
- src/modules/CannedMessageModule.h
- src/security/EncryptedStorage.h
- src/gps/GPS.h
- src/graphics/draw/DebugRenderer.cpp
- src/graphics/niche/InkHUD/InkHUD.h
- src/graphics/Screen.cpp
- src/motion/BMI270Sensor.cpp
- src/graphics/draw/NotificationRenderer.cpp
- src/modules/Telemetry/UnitConversions.cpp
- src/modules/OnScreenKeyboardModule.cpp
- src/mesh/http/ContentHandler.cpp
- src/modules/CannedMessageModule.cpp
addFromString was removed, so the comment no longer describes the API.
|
Addressed the review comment: dropped the Two points in the walkthrough do not match the diff. This PR adds no behavior; the only five added lines are the |
Initialize meshtastic_DeviceMetadata with its init_default macro so the has_xeddsa field is always set. cppcheck reported deviceMetadata.has_xeddsa as an uninitialized variable, failing the cppcheck jobs.
Removes function definitions that have no call sites.
Method
Definitions were extracted mechanically and every candidate was then verified individually against
src,test,variants,liband the external device-ui checkout, checking for virtual dispatch, function-pointer and callback registration, and platform ifdef guards. 158 candidates were reviewed; false positives were kept.Deliberately kept:
src/platformand LovyanGFXAdminModule::handleGetNodeRemoteHardwarePins,Channels::setDefaultPresetCryptoForHashandMeshService::getNodenumFromRequestId, which are unused but would be protocol or feature changes rather than cleanupNotes
The OnScreenKeyboardModule popup chain is removed as a unit.
showPopupwas the only writer ofpopupVisible, and its only caller was already unreferenced, sodrawPopup,drawPopupOverlayandclearPopupwere reachable but permanently inert. This is fallout from the frame based UI being replaced by baseUI.htmlDeleteDirbecame unreachable oncehandleDeleteFsContentwas removed; it was only ever reached through that handler plus its own recursion.ThreadedMessageApplet::saveMessagesToFlashis a vestigial wrapper, not a missing save. Persistence moved toEvents::beforeDeepSleepandEvents::beforeReboot.Verification
Local run used the
native-windowsenv, which is headless (HAS_SCREEN=0), so the graphics and InkHUD changes are not covered locally and rely on CI. No deleted symbol appears in the local build log.Summary by CodeRabbit
New Features
Changes
Documentation