Code Review Suggestions Summary for PR #69
This issue summarizes the suggestions from the comprehensive code review of PR #69 (Vrprouting no vroom no ortools).
🚨 Critical Issues (Must Fix)
String Concatenation Bugs
- File:
include/cpp_common/assert.hpp (Lines 95-101, 118-124)
- Issue: Unsafe string concatenation in pgassert macros - attempting pointer arithmetic instead of string concatenation
- Fix: Wrap string literals in
std::string() to force proper concatenation
Compilation Errors
- File:
include/initialsol/simple.hpp (Lines 39-40)
- Issue: Class name casing mismatch -
Vehicle_PickDeliver vs Vehicle_pickDeliver will break compilation
- Fix: Align class name casing consistently
Undefined Behavior
- File:
include/cpp_common/identifiers.hpp (Lines 81-83)
- Issue:
back() dereferences end() which is undefined behavior
- Fix: Use
rbegin() instead of end()
🔧 Missing Dependencies & Includes
Missing Headers
- File:
include/cpp_common/check_get_data.hpp (Line 42-48)
- Issue: Missing
<type_traits> include for std::is_integral
- Fix: Add
#include <type_traits>
Missing Documentation Files
- File:
doc/pgr_pickDeliver/vrp_oneDepot.rst (Lines 61-66)
- Issue: Missing
oneDepot.queries file breaks docs build
- Fix: Create missing file or update path reference
📚 Documentation Issues
Function Name Mismatches
- File:
doc/version/vrp_full_version.rst (Lines 47-49)
- Issue: Signature shows
pgr_full_version() but should be vrp_full_version()
- Fix: Update function name in signature block
Broken Include Paths
- File:
doc/version/vrp_full_version.rst & doc/version/vrp_version.rst (Lines 41-55)
- Issue: References non-existent
full_version.queries files
- Fix: Update paths to use
../../docqueries/version/full_version.pg
Sphinx Syntax Errors
- File:
doc/general/concepts.rst (Line 76)
- Issue: Invalid Sphinx note directive syntax
- Fix: Change
.. note To be defined to .. note:: To be defined
🧹 Code Quality Improvements
Build System
- File:
CMakeLists.txt (Lines 9-19)
- Issue: Setting CMake policies to OLD suppresses intended behavior
- Recommendation: Consider using NEW policies for future-proofing
Workflow Improvements
- File:
.github/workflows/website.yml (Multiple lines)
- Issues:
- Deprecated apt-key usage
- Missing PROJECT_VERSION fallbacks
- Unsafe branch handling
- Fix: Use keyring-based approach and add safety guards
Memory Management
- File:
include/cpp_common/messages.hpp (Lines 54-57)
- Issue: No-op copy constructor can cause silent data loss
- Recommendation: Delete copy operations and enable move semantics
📝 Documentation & Content Fixes
Typos & Grammar (Multiple Files)
- "Github" → "GitHub" (NEWS.md, release_notes.rst)
- "Mayors" → "Majors" (release_notes.rst)
- "addding" → "adding" (NEWS.md, release_notes.rst)
- "Uassigned" → "Unassigned" (NEWS.md, release_notes.rst)
- "emtpy" → "empty" (base_matrix.hpp)
- "Insetion" → "Insertion" (initials_code.hpp)
Consistency Issues
- Function name casing standardization needed
- Sponsor name capitalization consistency
- Version placeholders need updating
🔄 Cleanup Tasks
Remaining VROOM/OR-Tools References
- File:
configuration.conf (Lines 18-31)
- Issue: Residual VROOM/OR-Tools references across code, configs, and docs
- Action: Complete removal of all remaining references
Dead Code Removal
- Unreachable break statements after returns
- Unused variables in workflows
- Duplicate documentation blocks
💡 Minor Enhancements
Code Modernization
- Replace
throw() with noexcept
- Use
explicit constructors appropriately
- Improve error handling patterns
Documentation Improvements
- Add experimental function warnings where missing
- Improve code examples and descriptions
- Standardize formatting and structure
Priority: Address critical issues first, then missing dependencies, followed by documentation fixes and code quality improvements.
Related PR: #69
Reported by: @cvvergara
Original Review: #69
This issue serves as a tracking mechanism for implementing the code review suggestions. Please check off items as they are addressed.
Code Review Suggestions Summary for PR #69
This issue summarizes the suggestions from the comprehensive code review of PR #69 (Vrprouting no vroom no ortools).
🚨 Critical Issues (Must Fix)
String Concatenation Bugs
include/cpp_common/assert.hpp(Lines 95-101, 118-124)std::string()to force proper concatenationCompilation Errors
include/initialsol/simple.hpp(Lines 39-40)Vehicle_PickDelivervsVehicle_pickDeliverwill break compilationUndefined Behavior
include/cpp_common/identifiers.hpp(Lines 81-83)back()dereferencesend()which is undefined behaviorrbegin()instead ofend()🔧 Missing Dependencies & Includes
Missing Headers
include/cpp_common/check_get_data.hpp(Line 42-48)<type_traits>include forstd::is_integral#include <type_traits>Missing Documentation Files
doc/pgr_pickDeliver/vrp_oneDepot.rst(Lines 61-66)oneDepot.queriesfile breaks docs build📚 Documentation Issues
Function Name Mismatches
doc/version/vrp_full_version.rst(Lines 47-49)pgr_full_version()but should bevrp_full_version()Broken Include Paths
doc/version/vrp_full_version.rst&doc/version/vrp_version.rst(Lines 41-55)full_version.queriesfiles../../docqueries/version/full_version.pgSphinx Syntax Errors
doc/general/concepts.rst(Line 76).. note To be definedto.. note:: To be defined🧹 Code Quality Improvements
Build System
CMakeLists.txt(Lines 9-19)Workflow Improvements
.github/workflows/website.yml(Multiple lines)Memory Management
include/cpp_common/messages.hpp(Lines 54-57)📝 Documentation & Content Fixes
Typos & Grammar (Multiple Files)
Consistency Issues
🔄 Cleanup Tasks
Remaining VROOM/OR-Tools References
configuration.conf(Lines 18-31)Dead Code Removal
💡 Minor Enhancements
Code Modernization
throw()withnoexceptexplicitconstructors appropriatelyDocumentation Improvements
Priority: Address critical issues first, then missing dependencies, followed by documentation fixes and code quality improvements.
Related PR: #69
Reported by: @cvvergara
Original Review: #69
This issue serves as a tracking mechanism for implementing the code review suggestions. Please check off items as they are addressed.