Skip to content

chore: rename all _ prefixed functions to camelCase#437

Merged
hhvrc merged 5 commits intodevelopfrom
chore/cleanup-function-names
Mar 27, 2026
Merged

chore: rename all _ prefixed functions to camelCase#437
hhvrc merged 5 commits intodevelopfrom
chore/cleanup-function-names

Conversation

@hhvrc
Copy link
Copy Markdown
Contributor

@hhvrc hhvrc commented Mar 27, 2026

No description provided.

hhvrc and others added 4 commits December 18, 2025 21:57
Apply consistent naming convention across the codebase:
- Static/file-local functions: camelCase (no prefix)
- Add missing `static` keyword to file-local functions

26 files modified, covering CommandHandler, Config, SemVer, WiFiManager,
WiFiScanManager, VisualStateManager, SerialInputHandler, all 17 serial
command handlers, and serialization helpers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v21.1.8) reports: 12 file(s) not formatted
  • src/CommandHandler.cpp
  • src/SemVer.cpp
  • src/config/Config.cpp
  • src/config/internal/utils.cpp
  • src/serial/SerialInputHandler.cpp
  • src/serial/command_handlers/networks.cpp
  • src/serial/command_handlers/rftxpin.cpp
  • src/serial/command_handlers/validgpios.cpp
  • src/serialization/WSLocal.cpp
  • src/visual/VisualStateManager.cpp
  • src/wifi/WiFiManager.cpp
  • src/wifi/WiFiScanManager.cpp
clang-tidy (v21.1.8) reports: 532 concern(s)
  • src/CommandHandler.cpp:27:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       27 | static uint32_t calculateEepyTime(int64_t timeToKeepAlive)
          |                 ^
  • src/CommandHandler.cpp:40:31: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 's_rfTransmitterMutex' is non-const and globally accessible, consider making it const

       40 | static OpenShock::SimpleMutex s_rfTransmitterMutex               = {};
          |                               ^
  • src/CommandHandler.cpp:41:50: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 's_rfTransmitter' is non-const and globally accessible, consider making it const

       41 | static std::shared_ptr<OpenShock::RFTransmitter> s_rfTransmitter = nullptr;
          |                                                  ^
  • src/CommandHandler.cpp:43:50: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       43 | static std::shared_ptr<OpenShock::RFTransmitter> GetTransmitter()
          |                                                  ^
  • src/CommandHandler.cpp:45:25: warning: [bugprone-reserved-identifier]

    declaration uses identifier 'lock__', which is a reserved identifier

       45 |   OpenShock::ScopedLock lock__(&s_rfTransmitterMutex);
          |                         ^~~~~~
          |                         lock_
  • src/CommandHandler.cpp:48:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       48 | static bool TryCreateTransmitter(gpio_num_t txPin)
          |        ~~~~ ^                                     
          |        auto                                        -> bool
  • src/CommandHandler.cpp:55:25: warning: [bugprone-reserved-identifier]

    declaration uses identifier 'lock__', which is a reserved identifier

       55 |   OpenShock::ScopedLock lock__(&s_rfTransmitterMutex);
          |                         ^~~~~~
          |                         lock_
  • src/CommandHandler.cpp:61:25: warning: [bugprone-reserved-identifier]

    declaration uses identifier 'lock__', which is a reserved identifier

       61 |   OpenShock::ScopedLock lock__(&s_rfTransmitterMutex);
          |                         ^~~~~~
          |                         lock_
  • src/CommandHandler.cpp:65:31: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 's_keepAliveMutex' is non-const and globally accessible, consider making it const

       65 | static OpenShock::SimpleMutex s_keepAliveMutex = {};
          |                               ^
  • src/CommandHandler.cpp:66:22: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 's_keepAliveQueue' is non-const and globally accessible, consider making it const

       66 | static QueueHandle_t s_keepAliveQueue          = nullptr;
          |                      ^
  • src/CommandHandler.cpp:67:21: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 's_keepAliveTaskHandle' is non-const and globally accessible, consider making it const

       67 | static TaskHandle_t s_keepAliveTaskHandle      = nullptr;
          |                     ^
  • src/CommandHandler.cpp:130:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      130 | static bool internalSetKeepAliveEnabled(bool enabled)
          |        ~~~~ ^                                        
          |        auto                                           -> bool
  • src/CommandHandler.cpp:138:14: warning: [bugprone-reserved-identifier]

    declaration uses identifier 'lock__', which is a reserved identifier

      138 |   ScopedLock lock__(&s_keepAliveMutex);
          |              ^~~~~~
          |              lock_
  • src/CommandHandler.cpp:149:87: warning: [cppcoreguidelines-avoid-magic-numbers]

    4096 is a magic number; consider replacing it with a named constant

      149 |     if (TaskUtils::TaskCreateExpensive(commandhandler_keepalivetask, "KeepAliveTask", 4096, nullptr, 1, &s_keepAliveTaskHandle) != pdPASS) {  // PROFILED: 1.5KB stack usage
          |                                                                                       ^
  • src/CommandHandler.cpp:189:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      189 | bool CommandHandler::Init()
          | ~~~~                 ^     
          | auto                        -> bool
  • src/CommandHandler.cpp:249:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      249 | bool CommandHandler::Ok()
          | ~~~~                 ^   
          | auto                      -> bool
  • src/CommandHandler.cpp:254:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      254 | SetGPIOResultCode CommandHandler::SetRfTxPin(gpio_num_t txPin)
          | ~~~~~~~~~~~~~~~~~                 ^                           
          | auto                                                           -> SetGPIOResultCode
  • src/CommandHandler.cpp:276:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      276 | bool CommandHandler::SetKeepAliveEnabled(bool enabled)
          | ~~~~                 ^                                
          | auto                                                   -> bool
  • src/CommandHandler.cpp:290:28: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      290 | gpio_num_t CommandHandler::GetRfTxPin()
          | ~~~~~~~~~~                 ^           
          | auto                                    -> gpio_num_t
  • src/CommandHandler.cpp:297:14: warning: [cppcoreguidelines-init-variables]

    variable 'txPin' is not initialized

      297 |   gpio_num_t txPin;
          |              ^
  • src/CommandHandler.cpp:306:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      306 | bool CommandHandler::HandleCommand(ShockerModelType model, uint16_t shockerId, ShockerCommandType type, uint8_t intensity, uint16_t durationMs)
          | ~~~~                 ^                                                                                                                         
          | auto                                                                                                                                            -> bool
  • src/CommandHandler.cpp:306:105: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'HandleCommand' of similar type ('int') are easily swapped by mistake

      306 | bool CommandHandler::HandleCommand(ShockerModelType model, uint16_t shockerId, ShockerCommandType type, uint8_t intensity, uint16_t durationMs)
          |                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/CommandHandler.cpp:306:113: note: the first parameter in the range is 'intensity'
      306 | bool CommandHandler::HandleCommand(ShockerModelType model, uint16_t shockerId, ShockerCommandType type, uint8_t intensity, uint16_t durationMs)
          |                                                                                                                 ^~~~~~~~~
    src/CommandHandler.cpp:306:133: note: the last parameter in the range is 'durationMs'
      306 | bool CommandHandler::HandleCommand(ShockerModelType model, uint16_t shockerId, ShockerCommandType type, uint8_t intensity, uint16_t durationMs)
          |                                                                                                                                     ^~~~~~~~~~
  • src/CommandHandler.cpp:314:8: warning: [readability-identifier-length]

    variable name 'ok' is too short, expected at least 3 characters

      314 |   bool ok = transmitter->SendCommand(model, shockerId, type, intensity, durationMs);
          |        ^
  • src/CommandHandler.cpp:316:14: warning: [bugprone-reserved-identifier]

    declaration uses identifier 'lock__ka', which is a reserved identifier

      316 |   ScopedLock lock__ka(&s_keepAliveMutex);
          |              ^~~~~~~~
          |              lock_ka
  • src/SemVer.cpp:15:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       15 | static constexpr bool semverIsLetter(char c)
          |                  ~~~~ ^                     
          |                  auto                        -> bool
  • src/SemVer.cpp:15:43: warning: [readability-identifier-length]

    parameter name 'c' is too short, expected at least 3 characters

       15 | static constexpr bool semverIsLetter(char c)
          |                                           ^
  • src/SemVer.cpp:19:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       19 | static constexpr bool semverIsPositiveDigit(char c)
          |                  ~~~~ ^                            
          |                  auto                               -> bool
  • src/SemVer.cpp:19:50: warning: [readability-identifier-length]

    parameter name 'c' is too short, expected at least 3 characters

       19 | static constexpr bool semverIsPositiveDigit(char c)
          |                                                  ^
  • src/SemVer.cpp:23:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       23 | static constexpr bool semverIsDigit(char c)
          |                  ~~~~ ^                    
          |                  auto                       -> bool
  • src/SemVer.cpp:23:42: warning: [readability-identifier-length]

    parameter name 'c' is too short, expected at least 3 characters

       23 | static constexpr bool semverIsDigit(char c)
          |                                          ^
  • src/SemVer.cpp:27:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       27 | static constexpr bool semverIsDigits(std::string_view str)
          |                  ~~~~ ^                                   
          |                  auto                                      -> bool
  • src/SemVer.cpp:30:12: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

       29 |   if (str.empty()) {
          |   ~~~~~~~~~~~~~~~~~~
          |   return !static_cast<bool>(str.empty())
       30 |     return false;
          |     ~~~~~~~^~~~~~
       31 |   }
          |   ~
       32 | 
       33 |   for (auto c : str) {
          |   ~~~~~~~~~~~~~~~~~~~~
       34 |     if (!semverIsDigit(c)) {
          |     ~~~~~~~~~~~~~~~~~~~~~~~~
       35 |       return false;
          |       ~~~~~~~~~~~~~
       36 |     }
          |     ~
       37 |   }
          |   ~
       38 | 
       39 |   return true;
          |   ~~~~~~~~~~~
  • src/SemVer.cpp:41:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       41 | static constexpr bool semverIsNonDigit(char c)
          |                  ~~~~ ^                       
          |                  auto                          -> bool
  • src/SemVer.cpp:41:45: warning: [readability-identifier-length]

    parameter name 'c' is too short, expected at least 3 characters

       41 | static constexpr bool semverIsNonDigit(char c)
          |                                             ^
  • src/SemVer.cpp:45:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       45 | static constexpr bool semverIsIdentifierChararacter(char c)
          |                  ~~~~ ^                                    
          |                  auto                                       -> bool
  • src/SemVer.cpp:45:58: warning: [readability-identifier-length]

    parameter name 'c' is too short, expected at least 3 characters

       45 | static constexpr bool semverIsIdentifierChararacter(char c)
          |                                                          ^
  • src/SemVer.cpp:49:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       49 | static constexpr bool semverIsIdentifierChararacters(std::string_view str)
          |                  ~~~~ ^                                                   
          |                  auto                                                      -> bool
  • src/SemVer.cpp:52:12: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

       51 |   if (str.empty()) {
          |   ~~~~~~~~~~~~~~~~~~
          |   return !static_cast<bool>(str.empty())
       52 |     return false;
          |     ~~~~~~~^~~~~~
       53 |   }
          |   ~
       54 | 
       55 |   for (auto c : str) {
          |   ~~~~~~~~~~~~~~~~~~~~
       56 |     if (!semverIsIdentifierChararacter(c)) {
          |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       57 |       return false;
          |       ~~~~~~~~~~~~~
       58 |     }
          |     ~
       59 |   }
          |   ~
       60 | 
       61 |   return true;
          |   ~~~~~~~~~~~
  • src/SemVer.cpp:63:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       63 | static constexpr bool semverIsNumericIdentifier(std::string_view str)
          |                  ~~~~ ^                                              
          |                  auto                                                 -> bool
  • src/SemVer.cpp:75:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       75 | static constexpr bool semverIsAlphanumericIdentifier(std::string_view str)
          |                  ~~~~ ^                                                   
          |                  auto                                                      -> bool
  • src/SemVer.cpp:111:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      111 | static constexpr bool semverIsBuildIdentifier(std::string_view str)
          |                  ~~~~ ^                                            
          |                  auto                                               -> bool
  • src/SemVer.cpp:115:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      115 | static constexpr bool semverIsPrereleaseIdentifier(std::string_view str)
          |                  ~~~~ ^                                                 
          |                  auto                                                    -> bool
  • src/SemVer.cpp:119:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      119 | static constexpr bool semverIsDotSeperatedBuildIdentifiers(std::string_view str)
          |                  ~~~~ ^                                                         
          |                  auto                                                            -> bool
  • src/SemVer.cpp:138:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      138 | static constexpr bool semverIsDotSeperatedPreleaseIdentifiers(std::string_view str)
          |                  ~~~~ ^                                                            
          |                  auto                                                               -> bool
  • src/SemVer.cpp:165:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      165 | static constexpr bool semverIsVersionCore(std::string_view str)
          |                  ~~~~ ^                                        
          |                  auto                                           -> bool
  • src/SemVer.cpp:171:25: warning: [cppcoreguidelines-avoid-c-arrays]

    do not declare C-style arrays, use 'std::array' instead

      171 |   std::string_view parts[3];
          |                         ^
  • src/SemVer.cpp:178:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      178 | static constexpr bool semverIsSemver(std::string_view str)
          |                  ~~~~ ^                                   
          |                  auto                                      -> bool
  • src/SemVer.cpp:221:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      221 | bool SemVer::isValid() const
          | ~~~~         ^              
          | auto                         -> bool
  • src/SemVer.cpp:221:14: warning: [readability-convert-member-functions-to-static]

    method 'isValid' can be made static

      221 | bool SemVer::isValid() const
          |              ^         ~~~~~
  • src/SemVer.cpp:234:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      234 | std::string SemVer::toString() const
          |                     ^
  • src/SemVer.cpp:234:21: warning: [readability-convert-member-functions-to-static]

    method 'toString' can be made static

      234 | std::string SemVer::toString() const
          |                     ^          ~~~~~
          | static 
  • src/SemVer.cpp:266:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      266 | bool SemVer::operator==(const SemVer& other) const
          | ~~~~         ^                                    
          | auto                                               -> bool
  • src/SemVer.cpp:271:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      271 | bool SemVer::operator<(const SemVer& other) const
          | ~~~~         ^                                   
          | auto                                              -> bool
  • src/SemVer.cpp:304:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      304 | bool SemVer::operator==(std::string_view other) const
          | ~~~~         ^                                       
          | auto                                                  -> bool
  • src/SemVer.cpp:314:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      314 | bool SemVer::operator<(std::string_view other) const
          | ~~~~         ^                                      
          | auto                                                 -> bool
  • src/SemVer.cpp:324:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      324 | bool OpenShock::TryParseSemVer(std::string_view semverStr, SemVer& semver)
          | ~~~~            ^                                                         
          | auto                                                                       -> bool
  • src/SemVer.cpp:326:25: warning: [cppcoreguidelines-avoid-c-arrays]

    do not declare C-style arrays, use 'std::array' instead

      326 |   std::string_view parts[3];
          |                         ^
  • src/SemVer.cpp:334:10: warning: [cppcoreguidelines-init-variables]

    variable 'plusIdx' is not initialized

      334 |   size_t plusIdx = patchStr.find('+');
          |          ^                           
          |                                       = 0
  • src/SemVer.cpp:335:10: warning: [cppcoreguidelines-init-variables]

    variable 'dashIdx' is not initialized

      335 |   size_t dashIdx = patchStr.find('-');
          |          ^                           
          |                                       = 0
  • src/config/Config.cpp:22:23: warning: [bugprone-reserved-identifier]

    declaration uses identifier '_configFS', which is reserved in the global namespace

       22 | static fs::LittleFSFS _configFS;
          |                       ^~~~~~~~~
          |                       configFS
  • src/config/Config.cpp:22:23: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable '_configFS' is non-const and globally accessible, consider making it const

  • src/config/Config.cpp:23:27: warning: [bugprone-reserved-identifier]

    declaration uses identifier '_configData', which is reserved in the global namespace

       23 | static Config::RootConfig _configData;
          |                           ^~~~~~~~~~~
          |                           configData
  • src/config/Config.cpp:23:27: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable '_configData' is non-const and globally accessible, consider making it const

  • src/config/Config.cpp:24:23: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable '_configMutex' is non-const and globally accessible, consider making it const

       24 | static ReadWriteMutex _configMutex;
          |                       ^
  • src/config/Config.cpp:26:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'CONFIG_LOCK_READ_ACTION' used; consider a 'constexpr' template function

       26 | #define CONFIG_LOCK_READ_ACTION(retval, action)  \
          |         ^
  • src/config/Config.cpp:34:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'CONFIG_LOCK_WRITE_ACTION' used; consider a 'constexpr' template function

       34 | #define CONFIG_LOCK_WRITE_ACTION(retval, action)  \
          |         ^
  • src/config/Config.cpp:42:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'CONFIG_LOCK_READ' used; consider a 'constexpr' template function

       42 | #define CONFIG_LOCK_READ(retval)  CONFIG_LOCK_READ_ACTION(retval, {})
          |         ^
  • src/config/Config.cpp:43:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'CONFIG_LOCK_WRITE' used; consider a 'constexpr' template function

       43 | #define CONFIG_LOCK_WRITE(retval) CONFIG_LOCK_WRITE_ACTION(retval, {})
          |         ^
  • src/config/Config.cpp:45:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       45 | static bool tryDeserializeConfig(const uint8_t* buffer, std::size_t bufferLen, OpenShock::Config::RootConfig& config)
          |        ~~~~ ^                                                                                                        
          |        auto                                                                                                           -> bool
  • src/config/Config.cpp:54:17: warning: [cppcoreguidelines-avoid-magic-numbers]

    4096 is a magic number; consider replacing it with a named constant

       54 |     .max_size = 4096,  // Should be enough
          |                 ^
  • src/config/Config.cpp:73:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       73 | static bool tryLoadConfig(TinyVec<uint8_t>& buffer)
          |        ~~~~ ^                                      
          |        auto                                         -> bool
  • src/config/Config.cpp:97:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       97 | static bool tryLoadConfig()
          |        ~~~~ ^              
          |        auto                 -> bool
  • src/config/Config.cpp:106:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      106 | static bool trySaveConfig(const uint8_t* data, std::size_t dataLen)
          |        ~~~~ ^                                                      
          |        auto                                                         -> bool
  • src/config/Config.cpp:124:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      124 | static bool trySaveConfig()
          |        ~~~~ ^              
          |        auto                 -> bool
  • src/config/Config.cpp:156:15: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      156 | static cJSON* getAsCJSON(bool withSensitiveData)
          |        ~~~~~~ ^                                 
          |        auto                                      -> cJSON*
  • src/config/Config.cpp:163:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      163 | std::string Config::GetAsJSON(bool withSensitiveData)
          |                     ^
  • src/config/Config.cpp:181:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      181 | bool Config::SaveFromJSON(std::string_view json)
          | ~~~~         ^                                  
          | auto                                             -> bool
  • src/config/Config.cpp:203:70: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      203 | flatbuffers::Offset<Serialization::Configuration::HubConfig> Config::GetAsFlatBuffer(flatbuffers::FlatBufferBuilder& builder, bool withSensitiveData)
          | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         ^                                                                               
          | auto                                                                                                                                                  -> flatbuffers::Offset<Serialization::Configuration::HubConfig>
  • src/config/Config.cpp:210:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      210 | bool Config::SaveFromFlatBuffer(const Serialization::Configuration::HubConfig* config)
          | ~~~~         ^                                                                        
          | auto                                                                                   -> bool
  • src/config/Config.cpp:222:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      222 | bool Config::GetRaw(TinyVec<uint8_t>& buffer)
          | ~~~~         ^                               
          | auto                                          -> bool
  • src/config/Config.cpp:229:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      229 | bool Config::SetRaw(const uint8_t* buffer, std::size_t size)
          | ~~~~         ^                                              
          | auto                                                         -> bool
  • src/config/Config.cpp:259:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      259 | bool Config::GetRFConfig(Config::RFConfig& out)
          | ~~~~         ^                                 
          | auto                                            -> bool
  • src/config/Config.cpp:268:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      268 | bool Config::GetWiFiConfig(Config::WiFiConfig& out)
          | ~~~~         ^                                     
          | auto                                                -> bool
  • src/config/Config.cpp:277:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      277 | bool Config::GetCaptivePortalConfig(Config::CaptivePortalConfig& out)
          | ~~~~         ^                                                       
          | auto                                                                  -> bool
  • src/config/Config.cpp:286:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      286 | bool Config::GetBackendConfig(Config::BackendConfig& out)
          | ~~~~         ^                                           
          | auto                                                      -> bool
  • src/config/Config.cpp:295:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      295 | bool Config::GetSerialInputConfig(Config::SerialInputConfig& out)
          | ~~~~         ^                                                   
          | auto                                                              -> bool
  • src/config/Config.cpp:304:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      304 | bool Config::GetOtaUpdateConfig(Config::OtaUpdateConfig& out)
          | ~~~~         ^                                               
          | auto                                                          -> bool
  • src/config/Config.cpp:313:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      313 | bool Config::GetEStop(Config::EStopConfig& out)
          | ~~~~         ^                                 
          | auto                                            -> bool
  • src/config/Config.cpp:322:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      322 | bool Config::SetRFConfig(const Config::RFConfig& config)
          | ~~~~         ^                                          
          | auto                                                     -> bool
  • src/config/Config.cpp:330:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      330 | bool Config::SetWiFiConfig(const Config::WiFiConfig& config)
          | ~~~~         ^                                              
          | auto                                                         -> bool
  • src/config/Config.cpp:338:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      338 | bool Config::SetCaptivePortalConfig(const Config::CaptivePortalConfig& config)
          | ~~~~         ^                                                                
          | auto                                                                           -> bool
  • src/config/Config.cpp:346:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      346 | bool Config::SetBackendConfig(const Config::BackendConfig& config)
          | ~~~~         ^                                                    
          | auto                                                               -> bool
  • src/config/Config.cpp:354:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      354 | bool Config::SetSerialInputConfig(const Config::SerialInputConfig& config)
          | ~~~~         ^                                                            
          | auto                                                                       -> bool
  • src/config/Config.cpp:362:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      362 | bool Config::SetOtaUpdateConfig(const Config::OtaUpdateConfig& config)
          | ~~~~         ^                                                        
          | auto                                                                   -> bool
  • src/config/Config.cpp:370:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      370 | bool Config::SetEStop(const Config::EStopConfig& config)
          | ~~~~         ^                                          
          | auto                                                     -> bool
  • src/config/Config.cpp:378:14: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'GetWiFiCredentials' is non-const and globally accessible, consider making it const

      378 | bool Config::GetWiFiCredentials(std::vector<Config::WiFiCredentials>& out)
          |              ^
  • src/config/Config.cpp:387:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      387 | bool Config::GetWiFiCredentials(cJSON* array, bool withSensitiveData)
          | ~~~~         ^                                                       
          | auto                                                                  -> bool
  • src/config/Config.cpp:400:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      400 | bool Config::SetWiFiCredentials(const std::vector<Config::WiFiCredentials>& credentials)
          | ~~~~         ^                                                                          
          | auto                                                                                     -> bool
  • src/config/Config.cpp:402:8: warning: [cppcoreguidelines-init-variables]

    variable 'foundZeroId' is not initialized

      402 |   bool foundZeroId = std::any_of(credentials.begin(), credentials.end(), [](const Config::WiFiCredentials& creds) { return creds.id == 0; });
          |        ^                                            
          |                                                      = false
  • src/config/Config.cpp:414:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      414 | bool Config::GetRFConfigTxPin(gpio_num_t& out)
          | ~~~~         ^                                
          | auto                                           -> bool
  • src/config/Config.cpp:423:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      423 | bool Config::SetRFConfigTxPin(gpio_num_t txPin)
          | ~~~~         ^                                 
          | auto                                            -> bool
  • src/config/Config.cpp:431:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      431 | bool Config::GetRFConfigKeepAliveEnabled(bool& out)
          | ~~~~         ^                                     
          | auto                                                -> bool
  • src/config/Config.cpp:440:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      440 | bool Config::SetRFConfigKeepAliveEnabled(bool enabled)
          | ~~~~         ^                                        
          | auto                                                   -> bool
  • src/config/Config.cpp:448:14: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'AnyWiFiCredentials' is non-const and globally accessible, consider making it const

      448 | bool Config::AnyWiFiCredentials(std::function<bool(const Config::WiFiCredentials&)> predicate)
          |              ^
  • src/config/Config.cpp:457:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      457 | uint8_t Config::AddWiFiCredentials(std::string_view ssid, std::string_view password, wifi_auth_mode_t authMode)
          |                 ^
  • src/config/Config.cpp:457:36: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'AddWiFiCredentials' of similar type ('int') are easily swapped by mistake

      457 | uint8_t Config::AddWiFiCredentials(std::string_view ssid, std::string_view password, wifi_auth_mode_t authMode)
          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/config/Config.cpp:457:53: note: the first parameter in the range is 'ssid'
      457 | uint8_t Config::AddWiFiCredentials(std::string_view ssid, std::string_view password, wifi_auth_mode_t authMode)
          |                                                     ^~~~
    src/config/Config.cpp:457:76: note: the last parameter in the range is 'password'
      457 | uint8_t Config::AddWiFiCredentials(std::string_view ssid, std::string_view password, wifi_auth_mode_t authMode)
          |                                                                            ^~~~~~~~
  • src/config/Config.cpp:461:11: warning: [readability-identifier-length]

    variable name 'id' is too short, expected at least 3 characters

      461 |   uint8_t id = 0;
          |           ^
  • src/config/Config.cpp:510:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      510 | bool Config::TryGetWiFiCredentialsByID(uint8_t id, Config::WiFiCredentials& credentials)
          | ~~~~         ^                                                                          
          | auto                                                                                     -> bool
  • src/config/Config.cpp:510:48: warning: [readability-identifier-length]

    parameter name 'id' is too short, expected at least 3 characters

      510 | bool Config::TryGetWiFiCredentialsByID(uint8_t id, Config::WiFiCredentials& credentials)
          |                                                ^
  • src/config/Config.cpp:524:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      524 | bool Config::TryGetWiFiCredentialsBySSID(const char* ssid, Config::WiFiCredentials& credentials)
          | ~~~~         ^                                                                                  
          | auto                                                                                             -> bool
  • src/config/Config.cpp:538:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      538 | uint8_t Config::GetWiFiCredentialsIDbySSID(const char* ssid)
          |                 ^
  • src/config/Config.cpp:551:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      551 | bool Config::PinWiFiCredentialsBSSID(uint8_t id, const uint8_t (&bssid)[6])
          | ~~~~         ^                                                             
          | auto                                                                        -> bool
  • src/config/Config.cpp:551:46: warning: [readability-identifier-length]

    parameter name 'id' is too short, expected at least 3 characters

      551 | bool Config::PinWiFiCredentialsBSSID(uint8_t id, const uint8_t (&bssid)[6])
          |                                              ^
  • src/config/Config.cpp:551:72: warning: [cppcoreguidelines-avoid-c-arrays]

    do not declare C-style arrays, use 'std::array' instead

      551 | bool Config::PinWiFiCredentialsBSSID(uint8_t id, const uint8_t (&bssid)[6])
          |                                                                        ^
  • src/config/Config.cpp:551:73: warning: [cppcoreguidelines-avoid-magic-numbers]

    6 is a magic number; consider replacing it with a named constant

      551 | bool Config::PinWiFiCredentialsBSSID(uint8_t id, const uint8_t (&bssid)[6])
          |                                                                         ^
  • src/config/Config.cpp:565:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      565 | bool Config::RemoveWiFiCredentials(uint8_t id)
          | ~~~~         ^                                
          | auto                                           -> bool
  • src/config/Config.cpp:565:44: warning: [readability-identifier-length]

    parameter name 'id' is too short, expected at least 3 characters

      565 | bool Config::RemoveWiFiCredentials(uint8_t id)
          |                                            ^
  • src/config/Config.cpp:580:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      580 | bool Config::ClearWiFiCredentials()
          | ~~~~         ^                     
          | auto                                -> bool
  • src/config/Config.cpp:589:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      589 | bool Config::GetWiFiHostname(std::string& out)
          | ~~~~         ^                                
          | auto                                           -> bool
  • src/config/Config.cpp:598:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      598 | bool Config::SetWiFiHostname(std::string hostname)
          | ~~~~         ^                                    
          | auto                                               -> bool
  • src/config/Config.cpp:607:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      607 | bool Config::GetBackendDomain(std::string& out)
          | ~~~~         ^                                 
          | auto                                            -> bool
  • src/config/Config.cpp:616:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      616 | bool Config::SetBackendDomain(std::string domain)
          | ~~~~         ^                                   
          | auto                                              -> bool
  • src/config/Config.cpp:624:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      624 | bool Config::HasBackendAuthToken()
          | ~~~~         ^                    
          | auto                               -> bool
  • src/config/Config.cpp:631:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      631 | bool Config::GetBackendAuthToken(std::string& out)
          | ~~~~         ^                                    
          | auto                                               -> bool
  • src/config/Config.cpp:640:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      640 | bool Config::SetBackendAuthToken(std::string token)
          | ~~~~         ^                                     
          | auto                                                -> bool
  • src/config/Config.cpp:648:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      648 | bool Config::ClearBackendAuthToken()
          | ~~~~         ^                      
          | auto                                 -> bool
  • src/config/Config.cpp:656:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      656 | bool Config::GetSerialInputConfigEchoEnabled(bool& out)
          | ~~~~         ^                                         
          | auto                                                    -> bool
  • src/config/Config.cpp:664:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      664 | bool Config::SetSerialInputConfigEchoEnabled(bool enabled)
          | ~~~~         ^                                            
          | auto                                                       -> bool
  • src/config/Config.cpp:672:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      672 | bool Config::GetOtaUpdateId(int32_t& out)
          | ~~~~         ^                           
          | auto                                      -> bool
  • src/config/Config.cpp:681:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      681 | bool Config::SetOtaUpdateId(int32_t updateId)
          | ~~~~         ^                               
          | auto                                          -> bool
  • src/config/Config.cpp:693:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      693 | bool Config::GetOtaUpdateStep(OtaUpdateStep& out)
          | ~~~~         ^                                   
          | auto                                              -> bool
  • src/config/Config.cpp:702:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      702 | bool Config::SetOtaUpdateStep(OtaUpdateStep updateStep)
          | ~~~~         ^                                         
          | auto                                                    -> bool
  • src/config/Config.cpp:714:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      714 | bool Config::GetEStopEnabled(bool& out)
          | ~~~~         ^                         
          | auto                                    -> bool
  • src/config/Config.cpp:723:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      723 | bool Config::SetEStopEnabled(bool enabled)
          | ~~~~         ^                            
          | auto                                       -> bool
  • src/config/Config.cpp:731:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      731 | bool Config::GetEStopGpioPin(gpio_num_t& out)
          | ~~~~         ^                               
          | auto                                          -> bool
  • src/config/Config.cpp:740:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      740 | bool Config::SetEStopGpioPin(gpio_num_t gpioPin)
          | ~~~~         ^                                  
          | auto                                             -> bool
  • src/config/internal/utils.cpp:12:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       12 | static bool utilFromJsonInt(T& val, const cJSON* json, const char* name, T defaultVal, int minVal, int maxVal)
          |        ~~~~ ^                                                                                                 
          |        auto                                                                                                    -> bool
  • src/config/internal/utils.cpp:12:88: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'utilFromJsonInt' of similar type ('int') are easily swapped by mistake

       12 | static bool utilFromJsonInt(T& val, const cJSON* json, const char* name, T defaultVal, int minVal, int maxVal)
          |                                                                                        ^~~~~~~~~~~~~~~~~~~~~~
    src/config/internal/utils.cpp:12:92: note: the first parameter in the range is 'minVal'
       12 | static bool utilFromJsonInt(T& val, const cJSON* json, const char* name, T defaultVal, int minVal, int maxVal)
          |                                                                                            ^~~~~~
    src/config/internal/utils.cpp:12:104: note: the last parameter in the range is 'maxVal'
       12 | static bool utilFromJsonInt(T& val, const cJSON* json, const char* name, T defaultVal, int minVal, int maxVal)
          |                                                                                                        ^~~~~~
  • src/config/internal/utils.cpp:43:31: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       43 | bool Config::Internal::Utils::FromU8GpioNum(gpio_num_t& val, uint8_t u8Val)
          | ~~~~                          ^                                            
          | auto                                                                        -> bool
  • src/config/internal/utils.cpp:71:31: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       71 | bool Config::Internal::Utils::FromFbsIPAddress(IPAddress& ip, const flatbuffers::String* fbsIP, const IPAddress& defaultIP)
          | ~~~~                          ^                                                                                            
          | auto                                                                                                                        -> bool
  • src/config/internal/utils.cpp:71:59: warning: [readability-identifier-length]

    parameter name 'ip' is too short, expected at least 3 characters

       71 | bool Config::Internal::Utils::FromFbsIPAddress(IPAddress& ip, const flatbuffers::String* fbsIP, const IPAddress& defaultIP)
          |                                                           ^
  • src/config/internal/utils.cpp:101:9: warning: [readability-implicit-bool-conversion]

    implicit conversion 'cJSON_bool' (aka 'int') -> 'bool'

      101 |   val = cJSON_IsTrue(jsonVal);
          |         ^                    
          |         (                     != 0)

Have any feedback or feature suggestions? Share it here.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hhvrc hhvrc merged commit 366e548 into develop Mar 27, 2026
19 checks passed
@hhvrc hhvrc deleted the chore/cleanup-function-names branch March 27, 2026 06:48
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant