Created
November 14, 2018 23:13
-
-
Save mjcarroll/da3b985a9757979c0e793975a12373f3 to your computer and use it in GitHub Desktop.
Clang Tidy on ign-gazebo
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
| Checks: '-*,clang-analyzer-*,modernize-*,performance-*,portability-*,readability-*' | |
| CheckOptions: | |
| - { key: readability-braces-around-statements.ShortStatementLines, value: 2 } | |
| - { key: readability-identifier-naming.NamespaceCase, value: lower_case } | |
| - { key: readability-identifier-naming.ClassCase, value: CamelCase } | |
| - { key: readability-identifier-naming.StructCase, value: CamelCase } | |
| - { key: readability-identifier-naming.FunctionCase, value: CamelCase } | |
| - { key: readability-identifier-naming.ParameterPrefix, value: _ } | |
| - { key: readability-identifier-naming.VariableCase, value: camelBack } | |
| - { key: readability-identifier-naming.MemberCase, value: camelBack } | |
| - { key: readability-identifier-naming.GlobalConstantPrefix, value: k } | |
| - { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase } |
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
| (gazebo11_ws)➜ ign-gazebo clang-tidy-6.0 -p=../../build/ignition-gazebo/ `find ./src -name '*.cc' ! -iname '*TEST*'` | |
| 39643 warnings generated. | |
| 50847 warnings generated. | |
| 75709 warnings generated. | |
| 112483 warnings generated. | |
| 188193 warnings generated. | |
| 259346 warnings generated. | |
| 297899 warnings generated. | |
| 368312 warnings generated. | |
| 442099 warnings generated. | |
| 553366 warnings generated. | |
| 553373 warnings generated. | |
| 577372 warnings generated. | |
| 611210 warnings generated. | |
| 645042 warnings generated. | |
| 678874 warnings generated. | |
| 701664 warnings generated. | |
| 711901 warnings generated. | |
| 733080 warnings generated. | |
| 743333 warnings generated. | |
| 753570 warnings generated. | |
| 864859 warnings generated. | |
| 890659 warnings generated. | |
| 994311 warnings generated. | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:40:13: warning: invalid case style for function 'homePath' [readability-identifier-naming] | |
| std::string homePath() | |
| ^~~~~~~~~ | |
| HomePath | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:55:20: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default] | |
| public: explicit SystemManagerPrivate() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:62:39: warning: the parameter #3 is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param] | |
| sdf::ElementPtr /*_sdf*/, | |
| ~~~ ^ | |
| const & | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:142:16: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| SystemManager::~SystemManager() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:160:7: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty] | |
| if (_filename == "" || _name == "") | |
| ^~~~~~~~~~~~~~~ | |
| _filename.empty() | |
| /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:1022:7: note: method 'basic_string<char, std::char_traits<char>, std::allocator<char> >'::empty() defined here | |
| empty() const _GLIBCXX_NOEXCEPT | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:160:26: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty] | |
| if (_filename == "" || _name == "") | |
| ^~~~~~~~~~~~ | |
| _name.empty() | |
| /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:1022:7: note: method 'basic_string<char, std::char_traits<char>, std::allocator<char> >'::empty() defined here | |
| empty() const _GLIBCXX_NOEXCEPT | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:170:53: warning: parameter '_sdf' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param] | |
| _sdf, plugin); | |
| ^~~~~ | |
| std::move() | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SystemManager.cc:180:74: warning: the parameter '_sdf' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param] | |
| std::optional<SystemPluginPtr> SystemManager::LoadPlugin(sdf::ElementPtr _sdf) | |
| ~~~ ^ | |
| const & | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/ServerConfig.cc:38:15: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| ServerConfig::~ServerConfig() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/include/ignition/gazebo/EntityComponentManager.hh:99:20: warning: function 'ignition::gazebo::v0::View::AddComponent' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name] | |
| public: void AddComponent(const EntityId _id, | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/View.cc:29:12: note: the definition seen here | |
| void View::AddComponent(const EntityId _id, | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/include/ignition/gazebo/EntityComponentManager.hh:99:20: note: differing parameters are named here: ('_compTypeId', '_compId'), in definition: ('_compId', '_componentId') | |
| public: void AddComponent(const EntityId _id, | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/System.cc:22:9: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default] | |
| System::System() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/System.cc:27:9: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| System::~System() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:60:8: warning: implicit conversion 'const sdf::v8::Physics *' -> bool [readability-implicit-bool-conversion] | |
| if (!physics) | |
| ~^~~~~~~~ | |
| == nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:140:19: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| SimulationRunner::~SimulationRunner() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:236:17: warning: use emplace_back instead of push_back [modernize-use-emplace] | |
| this->systems.push_back(SystemInternal(_system)); | |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| emplace_back( | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:240:7: warning: implicit conversion 'ignition::gazebo::v0::ISystemPreUpdate *' -> bool [readability-implicit-bool-conversion] | |
| if (system.preupdate) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:243:7: warning: implicit conversion 'ignition::gazebo::v0::ISystemUpdate *' -> bool [readability-implicit-bool-conversion] | |
| if (system.update) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:246:7: warning: implicit conversion 'ignition::gazebo::v0::ISystemPostUpdate *' -> bool [readability-implicit-bool-conversion] | |
| if (system.postupdate) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:439:13: warning: implicit conversion 'const sdf::v8::Geometry *' -> bool [readability-implicit-bool-conversion] | |
| if (visual->Geom()) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:446:13: warning: implicit conversion 'sdf::Material *' -> bool [readability-implicit-bool-conversion] | |
| if (visual->Material()) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/SimulationRunner.cc:472:13: warning: implicit conversion 'const sdf::v8::Geometry *' -> bool [readability-implicit-bool-conversion] | |
| if (collision->Geom()) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/Server.cc:125:9: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Server::~Server() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/Null.cc:24:5: warning: initializer for base class 'ignition::gazebo::v0::System' is redundant [readability-redundant-member-init] | |
| : System() | |
| ^~~~~~~~ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/Null.cc:29:7: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Null::~Null() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/physics/Physics.cc:130:22: warning: initializer for base class 'ignition::gazebo::v0::System' is redundant [readability-redundant-member-init] | |
| Physics::Physics() : System(), dataPtr(std::make_unique<PhysicsPrivate>()) | |
| ^~~~~~~~~~ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/physics/Physics.cc:159:10: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Physics::~Physics() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/physics/Physics.cc:248:15: warning: implicit conversion 'const ignition::gazebo::components::v0::Inertial *' -> bool [readability-implicit-bool-conversion] | |
| if (inertial) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/physics/Physics.cc:333:17: warning: implicit conversion 'ignition::gazebo::components::v0::Pose *' -> bool [readability-implicit-bool-conversion] | |
| if (parentPose) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/include/ignition/gazebo/systems/SceneBroadcaster.hh:51:18: warning: function 'ignition::gazebo::systems::v0::SceneBroadcaster::PostUpdate' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name] | |
| public: void PostUpdate(const UpdateInfo &_info, | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:179:24: note: the definition seen here | |
| void SceneBroadcaster::PostUpdate(const UpdateInfo &/*_info*/, | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/include/ignition/gazebo/systems/SceneBroadcaster.hh:51:18: note: differing parameters are named here: ('_ecm'), in definition: ('_manager') | |
| public: void PostUpdate(const UpdateInfo &_info, | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:63:37: warning: the parameter '_msg' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param] | |
| void AddVisuals(msgs::LinkSharedPtr _msg, | |
| ~~~~ ^ | |
| const & | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:83:36: warning: the parameter '_msg' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param] | |
| void AddLinks(msgs::ModelSharedPtr _msg, | |
| ~~~~ ^ | |
| const & | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:169:5: warning: initializer for base class 'ignition::gazebo::v0::System' is redundant [readability-redundant-member-init] | |
| : System(), dataPtr(std::make_unique<SceneBroadcasterPrivate>()) | |
| ^~~~~~~~~~ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:174:19: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| SceneBroadcaster::~SceneBroadcaster() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:315:13: warning: implicit conversion 'const ignition::gazebo::components::v0::Geometry *' -> bool [readability-implicit-bool-conversion] | |
| if (geometryComp) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/systems/SceneBroadcaster.cc:323:13: warning: implicit conversion 'const ignition::gazebo::components::v0::Material *' -> bool [readability-implicit-bool-conversion] | |
| if (materialComp) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/main.cc:17:10: warning: inclusion of deprecated C++ header 'signal.h'; consider using 'csignal' instead [modernize-deprecated-headers] | |
| #include <signal.h> | |
| ^~~~~~~~~~ | |
| <csignal> | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/main.cc:121:26: warning: statement should be inside braces [readability-braces-around-statements] | |
| if (!info.is_default) | |
| ^ | |
| { | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/main.cc:123:9: warning: statement should be inside braces [readability-braces-around-statements] | |
| else | |
| ^ | |
| { | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/main.cc:198:11: warning: implicit conversion 'QQuickItem *' -> bool [readability-implicit-bool-conversion] | |
| if (gzDrawerItem) | |
| ^ ~ | |
| != nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/main.cc:219:16: warning: use std::make_unique instead [modernize-make-unique] | |
| server.reset(new ignition::gazebo::Server(serverConfig)); | |
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| = std::make_unique<ignition::gazebo::Server> | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/main.cc:228:7: warning: static member accessed through instance [readability-static-accessed-through-instance] | |
| app.exec(); | |
| ^~~~~~~~ | |
| ignition::gui::Application:: | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/Entity.cc:33:7: warning: invalid case style for variable 'a_variable' [readability-identifier-naming] | |
| int a_variable = 1; | |
| ^~~~~~~~~~ | |
| aVariable | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/Entity.cc:34:22: warning: invalid case style for parameter 'fcn_variable' [readability-identifier-naming] | |
| auto fcn = [](auto fcn_variable){}; | |
| ^~~~~~~~~~~~~ | |
| _fcn_variable | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/Entity.cc:35:10: warning: invalid case style for struct 'badStruct' [readability-identifier-naming] | |
| struct badStruct {}; | |
| ^~~~~~~~~ | |
| BadStruct | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/EventManager.cc:23:15: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default] | |
| EventManager::EventManager() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/EventManager.cc:28:15: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| EventManager::~EventManager() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Light.cc:28:33: warning: pass by value and use std::move [modernize-pass-by-value] | |
| public: explicit LightPrivate(const sdf::Light &_light) | |
| ^~~~~~~~~~~~~~~~~~~~~~~~ | |
| sdf::Light | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Light.cc:44:8: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Light::~Light() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Light.cc:61:15: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| Light &Light::operator=(Light &&_light) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Geometry.cc:28:36: warning: pass by value and use std::move [modernize-pass-by-value] | |
| public: explicit GeometryPrivate(const sdf::Geometry &_geometry) | |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| sdf::Geometry | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Geometry.cc:44:11: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Geometry::~Geometry() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Geometry.cc:61:21: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| Geometry &Geometry::operator=(Geometry &&_geometry) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Material.cc:28:36: warning: pass by value and use std::move [modernize-pass-by-value] | |
| public: explicit MaterialPrivate(const sdf::Material &_material) | |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| sdf::Material | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Material.cc:44:11: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Material::~Material() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Material.cc:61:21: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| Material &Material::operator=(Material &&_material) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Inertial.cc:57:11: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Inertial::~Inertial() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Inertial.cc:70:21: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| Inertial &Inertial::operator=(Inertial &&_inertial) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/ParentEntity.cc:44:15: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| ParentEntity::~ParentEntity() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/ParentEntity.cc:61:29: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| ParentEntity &ParentEntity::operator=(ParentEntity &&_parentEntity) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Pose.cc:57:7: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Pose::~Pose() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Pose.cc:70:13: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| Pose &Pose::operator=(Pose &&_pose) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Name.cc:28:32: warning: pass by value and use std::move [modernize-pass-by-value] | |
| public: explicit NamePrivate(const std::string &_name) | |
| ^~~~~~~~~~~~~~~~~~~~~~~~ | |
| std::string | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Name.cc:44:7: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| Name::~Name() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/Name.cc:61:13: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| Name &Name::operator=(Name &&_name) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/ChildEntity.cc:44:14: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] | |
| ChildEntity::~ChildEntity() | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/components/ChildEntity.cc:61:27: warning: move assignment operators should be marked noexcept [performance-noexcept-move-constructor] | |
| ChildEntity &ChildEntity::operator=(ChildEntity &&_childEntity) | |
| ^ | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/ServerPrivate.cc:121:8: warning: implicit conversion 'ignition::gui::Application *' -> bool [readability-implicit-bool-conversion] | |
| if (!gui::App()) | |
| ~^~~ ~ | |
| == nullptr | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/EntityComponentManager.cc:133:25: warning: invalid case style for variable '_id' [readability-identifier-naming] | |
| for (const EntityId _id : this->dataPtr->toEraseEntityIds) | |
| ^~~ | |
| id | |
| /home/michael/workspaces/gazebo11_ws/src/ign-gazebo/src/EntityComponentManager.cc:146:34: warning: invalid case style for variable '_key' [readability-identifier-naming] | |
| for (const ComponentKey &_key : this->dataPtr->entityComponents.at(_id)) | |
| ^~~~ | |
| key | |
| Suppressed 994260 warnings (994233 in non-user code, 18 NOLINT, 9 with check filters). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment