-
-
Notifications
You must be signed in to change notification settings - Fork 384
clang-tidy: add cppcoreguidelines-avoid-magic-numbers #3003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughAdded Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.clang-tidy(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
cvvergara
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I compiled locally using:
CXX=clang++ CC=clang cmake -DUSE_CLANG_TIDY=ON -DBUILD_HTML=ON -DPOSTGRESQL_BIN=${PGBIN} ..
and these are some of the many warnings I get that are not fixed
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:69:18: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
69 | EPSILON(0.0001),
| ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:76:20: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
76 | EPSILON = 0.0001,
| ^
[ 15%] Building CXX object src/allpairs/CMakeFiles/allpairs.dir/allpairs_driver.cpp.o
[ 16%] Building CXX object src/withPoints/CMakeFiles/withPoints.dir/withPoints.cpp.o
[ 17%] Building CXX object src/pickDeliver/CMakeFiles/pickDeliver.dir/fleet.cpp.o
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:69:18: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
69 | EPSILON(0.0001),
| ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:76:20: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
76 | EPSILON = 0.0001,
| ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/cpp_common/base_graph.hpp:831:32: warning: 0.5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
831 | graph[e].cost = (-0.5)*edge.cost;
| ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/cpp_common/base_graph.hpp:843:36: warning: 0.5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
843 | graph[e].cost = (-0.5)*edge.reverse_cost;
Your CI action workflows are not activated.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.