clang-tidy: add cppcoreguidelines-avoid-magic-numbers#3003
clang-tidy: add cppcoreguidelines-avoid-magic-numbers#3003Sohamsig wants to merge 4 commits intopgRouting:developfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdded Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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.
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.
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.