refactor(lane_change): move lane change param #5807
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 4 findings(s) 🚩
- Improving Code Health: 5 findings(s) ✅
- Affected Hotspots: 4 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):
- Complex Method normal.cpp: NormalLaneChange::getLaneChangePaths 🔥
- Complex Method manager.cpp: LaneChangeModuleManager::init
- Complex Method normal.cpp: NormalLaneChange::isLaneChangePathSafe 🔥
- Complex Method normal.cpp: NormalLaneChange::calcAbortPath 🔥
✅ Improving Code Health:
- Lines of Code in a Single File normal.cpp 🔥
- Overall Code Complexity utils.cpp 🔥
- Lines of Code in a Single File utils.cpp 🔥
- Large Method behavior_path_planner_node.cpp: BehaviorPathPlannerNode::getCommonParam 🔥
- Primitive Obsession utils.cpp 🔥
Annotations
Check notice on line 266 in planning/behavior_path_planner/src/behavior_path_planner_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Large Method
BehaviorPathPlannerNode::getCommonParam is no longer above the threshold for lines of code. 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 186 in planning/behavior_path_planner/src/scene_module/lane_change/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
LaneChangeModuleManager::init increases in cyclomatic complexity from 13 to 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 1 in planning/behavior_path_planner/src/scene_module/lane_change/normal.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1450 to 1448, 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 warning on line 1265 in planning/behavior_path_planner/src/scene_module/lane_change/normal.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
NormalLaneChange::getLaneChangePaths already has high cyclomatic complexity, and now it increases in Lines of Code from 248 to 250. 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 warning on line 1709 in planning/behavior_path_planner/src/scene_module/lane_change/normal.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
NormalLaneChange::isLaneChangePathSafe already has high cyclomatic complexity, and now it increases in Lines of Code from 73 to 74. 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 warning on line 1663 in planning/behavior_path_planner/src/scene_module/lane_change/normal.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
NormalLaneChange::calcAbortPath already has high cyclomatic complexity, and now it increases in Lines of Code from 120 to 121. 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 1 in planning/behavior_path_planner/src/utils/lane_change/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.00 to 4.94, 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/src/utils/lane_change/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 33.33% to 33.85%, 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 807 in planning/behavior_path_planner/src/utils/lane_change/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
convertToPredictedPath increases from 5 to 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more 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 better: Lines of Code in a Single File
The lines of code decreases from 1236 to 1215, 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.40 to 4.43, 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.25% to 30.77%, 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.