eclipse-uprotocol / up-transport-zenoh-cpp

C++ client library to connect to the zenoh implementation of uProtocol
Apache License 2.0
5 stars 15 forks source link

clang tidy: issues in ZenohUTransport.cpp #99

Open debruce opened 1 month ago

debruce commented 1 month ago

1) uError can be made static at line 28 2) message is unused at line 28 3) default_authority_name and sink are unused 4) zenoh_key is not initialized 5) invalid case style for writeUUri 6) 'if with identical then and else branches' at lines 44, 52, 60, 79, 257, 366 (code doesn't show that condition for any of these locations) 7) Missing user name in TODO comment at lines 109, 115 8) rpc_callbackmap uninitialized at line 177 9) invalid case style for defaultUri (line 177) and configFile (line 178) 10) configFile is unused 11) zenoh_key, listener, payload, listener, sinkfilter are unused at various places 12) missing user name in TODO comment at lines 182, 279 13) registerResponseListener (line 219), sendRequest (line 246), sendRespose (line 306), sendPublishNotification_ (line 333), registerListenerImpl (line 408), cleanupListener (line 439) can be made static 14) payload is unused at line 247 and 306 15) resp_callback is not initialized at line 255 16) zenoh_key not initialized at line 365 17) switch has 4 consecutive identical branches at line 375 (another error that isn't evident in the code)

I missed a few unused and/or uninitialized.

There are lots of cases where clang-tidy is reporting logical problems in the code that do not exist. The if-then-else branch detection inspector seems broken.