Technical Debt
Code quality issues and improvements
Technical Debt
This document tracks technical debt items in the OctoMY™ codebase. Items at the top should be fixed first. New items are added at the bottom.
Procedure for Fixing Technical Debt
For every item fixed, follow these 5 steps:
- Fix the code - Make the necessary changes to address the issue
- Build - Run incremental build to uncover and fix obvious errors
- Build clean - Run clean build to catch any hidden errors from shadowed sources
- Update this document - Remove the fixed item from the list below
- Commit - Summarize changes in a git commit
Code Conventions
Switch Case Fallthrough Policy
Switch case fallthrough is a common source of bugs. Follow these rules:
- Unintentional fallthrough - Add
break;statement at the end of each case - Intentional fallthrough - Add
[[fallthrough]];attribute before the next case label
Example of intentional fallthrough:
switch(value) {
case A:
doSomething();
[[fallthrough]]; // Explicitly mark intentional fallthrough
case B:
doSomethingElse();
break;
}
The [[fallthrough]] attribute (C++17) silences compiler warnings and documents intent for other developers.
Unused Variables and Parameters Policy
Use Q_UNUSED() macro to suppress warnings for intentionally unused variables and parameters. This approach:
- Documents intent - Makes it clear the parameter is intentionally unused
- Preserves API - Keeps parameter names visible for documentation and future use
- Silences warnings - Prevents compiler warnings without removing information
void MyClass::configure(KeyStore *keystore, AddressBook *peers)
{
Q_UNUSED(keystore);
Q_UNUSED(peers);
// Implementation pending or parameters reserved for future use
}
When to use Q_UNUSED:
- Parameters required by interface/virtual function but not used in implementation
- Parameters reserved for future functionality
- Loop variables in WIP code with commented-out body
When NOT to use Q_UNUSED:
- If the parameter can be removed from the signature entirely
- If the code should actually use the parameter (fix the implementation instead)
Qt5 Legacy References
The project targets Qt6 only. The following files contain Qt5 references that need cleanup or migration.
Android Build Files (Need Qt6 Migration)
These files reference org.qtproject.qt5.android.bindings and need updating to Qt6's Android structure:
src/agent/android/gradle.propertiessrc/agent/android/build.gradlesrc/agent/android/AndroidManifest.xmlsrc/agent/android/src/org/octomy/agent/Agent.javasrc/agent/android/res/values/libs.xmlsrc/remote/android/gradle.propertiessrc/remote/android/build.gradlesrc/remote/android/AndroidManifest.xmlsrc/remote/android/src/org/octomy/remote/Remote.javasrc/remote/android/res/values/libs.xmlsrc/hub/android/gradle.propertiessrc/hub/android/build.gradlesrc/hub/android/AndroidManifest.xmlsrc/hub/android/src/org/octomy/hub/Hub.javasrc/hub/android/res/values/libs.xml
Legacy Release/Docker Files
Old build infrastructure targeting Qt 5.10.0:
integration/release_management/Dockerfile.qt5.10.0_static_ubuntu_amd64integration/release_management/Dockerfile.deb_fileintegration/release_management/Dockerfile.deb_testintegration/release_management/build.shintegration/release_management/README.mdintegration/local/tool.sh(XKB fixes comment for Qt5.4x)
Source Code with Qt5 Version Checks
src/libs/libpair/pairing/camera/CameraPairingWidget.cpp:184-#ifdef QT5_STUFF(guards disabled legacy code awaiting Qt6 QMultimedia rewrite)
Build Warnings
Enum/Integer Mismatch (libmarkdown)
src/libs/libmarkdown/markdown/autolink.c:151,188,245- conflicting types due to enum/integer mismatch
#warning Directives
src/libs/libclt/clt/CLWorker.cpp:327- "CL STUFF DISABLED BECAUSE... QT6"
Debug Statements to Remove
XXX Debug Statements
These debug statements with "XXX" markers should be cleaned up:
src/libs/libpair/delivery/BirthControl.cpp:146,186,191,194,199,200src/libs/libpair/delivery/ControlDeliveryActivity.cpp:96,119,189,191,196,197src/libs/libpair/delivery/AgentDeliveryActivity.cpp:89
TODO Comments (Categorized)
High Priority - Implementation Incomplete
src/libs/libnode/node/Node.cpp:657- "TODO: Implement"src/libs/libnode/node/Node.hpp:405- "TODO: Implement"src/libs/libardumy/ardumy/ArduMYController.cpp:567- "TODO: Implement"
Medium Priority - Needs Refactoring
src/libs/libpair/pairing/camera/CameraPairingWidget.hpp:37,57- "TODO: Rework this with new qmultimedia primitives for Qt6"src/libs/libpair/pairing/camera/CameraPairingWidget.cpp:23,67,83,162- "TODO: Rework this with new qmultimedia primitives for Qt6"src/libs/libremote/remote/ControlUnboxingWizard.cpp:187- "TODO: refactor activity system"
Low Priority - Improvements/Features
src/libs/libstore/store/DataStore.cpp:45- unnecessary load preventionsrc/libs/libstore/store/AsyncStore.hpp:228,779- load/error handlingsrc/libs/libnode/node/Node.cpp:108- simplify init systemsrc/libs/libpair/discovery/DiscoveryClient.cpp:457- remove old unused courierssrc/libs/libpair/address/AddressList.cpp:203,212- implement if needed
Security-Related
src/libs/libpair/address/Associate.cpp:70,74- intensify security checksrc/libs/libardumy/ardumy_arduino/parser/ArduMYCommandParser.hpp:15- escaping for magic sequence
Code Quality Issues
Q_UNUSED Macro Usage
425 occurrences of Q_UNUSED across 175 files. Many may indicate incomplete implementations or unnecessary parameters that should be refactored.
Large Debug Output Count
Approximately 399 qDebug()/qWarning() calls across 50 files (first 50). Consider:
- Adding log levels
- Using centralized logging (liblog)
- Removing debug statements before release builds
Incomplete Features
CameraPairingWidget
Multiple TODO comments indicate this needs complete rework for Qt6 QMultimedia:
src/libs/libpair/pairing/camera/CameraPairingWidget.cppsrc/libs/libpair/pairing/camera/CameraPairingWidget.hpp
OpenCL Support (libclt)
src/libs/libclt/clt/CLWorker.cpp:327- OpenCL disabled for Qt6, needs reimplementation
Widget Consolidation
All widgets should live in libwidgets. The following widgets are scattered across other libraries and should be migrated:
Widgets in libpair (should move to libwidgets)
src/libs/libpair/pairing/trust/TrustSymbolWidget.*src/libs/libpair/pairing/list/PairingListWidget.*src/libs/libpair/connection/ConnectionStatusWidget.*src/libs/libpair/connection/SignalStrengthWidget.*src/libs/libpair/discovery/PingWidget.*(if exists)
Widgets in libnode (should move to libwidgets)
src/libs/libnode/node/PortableIDWidget.*
Note: When migrating, update all include paths and ensure library dependencies are correct.
Style/Convention Issues
Inconsistent Naming
Review these for naming convention compliance:
- Methods named same as class types causing compiler warnings (fixed in AutomationBookModel)