feat(start_planner): prevent hindering rear vehicles #6545
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 5 findings(s) ✅
- Affected Hotspots: 3 files(s) 🔥
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
Details
🚩 Declining Code Health (highest to lowest):
- Large Method manager.cpp: StartPlannerModuleManager::updateModuleParams
- Large Method manager.cpp: StartPlannerModuleManager::init
- Complex Method start_planner_module.cpp: StartPlannerModule::isPreventingRearVehicleFromPassingThrough 🔥
✅ Improving Code Health:
- Overall Code Complexity utils.cpp 🔥
- Complex Method start_planner_module.cpp: StartPlannerModule::calcTurnSignalInfo 🔥
- Primitive Obsession utils.cpp 🔥
- Bumpy Road Ahead start_planner_module.cpp: StartPlannerModule::isOverlapWithCenterLane 🔥
- Deep, Nested Complexity start_planner_module.cpp: StartPlannerModule::isOverlapWithCenterLane 🔥
Annotations
Check notice on line 1 in planning/behavior_path_start_planner_module/src/start_planner_module.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1285 to 1367, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Method
StartPlannerModule::calcTurnSignalInfo decreases in cyclomatic complexity from 16 to 15, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
StartPlannerModule::isPreventingRearVehicleFromPassingThrough has a cyclomatic complexity of 17, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 424 in planning/behavior_path_start_planner_module/src/start_planner_module.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
StartPlannerModule::isOverlapWithCenterLane is no longer above the threshold for logical blocks with deeply nested code. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
Check notice on line 424 in planning/behavior_path_start_planner_module/src/start_planner_module.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Deep, Nested Complexity
StartPlannerModule::isOverlapWithCenterLane is no longer above the threshold for nested complexity depth
Check notice on line 1 in planning/behavior_path_lane_change_module/src/utils/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.67 to 4.66, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
Check notice on line 1 in planning/behavior_path_lane_change_module/src/utils/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 34.29% to 34.56%, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.
Check notice on line 1 in planning/behavior_path_planner_common/src/utils/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1275 to 1303, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
Check notice on line 1 in planning/behavior_path_planner_common/src/utils/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 4.47 to 4.48, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
Check notice on line 1 in planning/behavior_path_planner_common/src/utils/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 31.29% to 31.14%, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.
Check warning on line 379 in planning/behavior_path_start_planner_module/src/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
StartPlannerModuleManager::updateModuleParams increases from 352 to 355 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check warning on line 48 in planning/behavior_path_start_planner_module/src/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
StartPlannerModuleManager::init increases from 288 to 290 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.