feat(planning_factor)!: remove velocity_factor, steering_factor and introduce planning_factor #9927
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.00 (6.27 -> 6.27)
- Declining Code Health: 9 findings(s) 🚩
- Improving Code Health: 10 findings(s) ✅
- Affected Hotspots: 6 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Complex Method planner_interface.cpp: PlannerInterface::generateSlowDownTrajectory
- Code Duplication behavior_path_planner_node.cpp 🔥
- Code Duplication planning.cpp
- Overall Code Complexity planning.cpp
- Complex Conditional planning.cpp: convert
- Complex Method scene_merge_from_private_road.cpp: MergeFromPrivateRoadModule::modifyPathVelocity
- Complex Method planning.cpp: PlanningNode::on_timer
- Complex Method planning.cpp: convert
- Complex Method planning.cpp: convert
✅ Improving Code Health:
- Complex Method out_of_lane_module.cpp: OutOfLaneModule::plan
- Overall Code Complexity goal_planner_module.cpp 🔥
- Overall Code Complexity behavior_path_planner_node.cpp 🔥
- Lines of Code in a Single File start_planner_module.cpp 🔥
- Lines of Code in a Single File scene.cpp 🔥
- Large Method dynamic_obstacle_stop_module.cpp: DynamicObstacleStopModule::plan
- Large Method behavior_path_planner_node.cpp: BehaviorPathPlannerNode::BehaviorPathPlannerNode 🔥
- Complex Method node.cpp: MotionVelocityPlannerNode::generate_trajectory
- Bumpy Road Ahead behavior_path_planner_node.cpp: BehaviorPathPlannerNode::BehaviorPathPlannerNode 🔥
- Overall Code Complexity out_of_lane_module.cpp
Annotations
Check notice on line 1 in planning/autoware_obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1735 to 1736, 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 worse: Overall Function Size
The median function size increase from 55.0 to 55.5 LOC, threshold = 50.0. This file contains overly long functions, measured by their lines of code.
Check warning on line 600 in planning/autoware_obstacle_cruise_planner/src/planner_interface.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
PlannerInterface::generateSlowDownTrajectory already has high cyclomatic complexity, and now it increases in Lines of Code from 125 to 129. 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)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1428 to 1427, 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)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: BehaviorPathPlannerNode::getRunningModules,BehaviorPathPlannerNode::getWaitingApprovalModules. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Large Method
BehaviorPathPlannerNode::BehaviorPathPlannerNode 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
BehaviorPathPlannerNode::BehaviorPathPlannerNode 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.30 to 5.21, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 6.54 to 6.52, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1451 to 1450, 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: Large Method
DynamicObstacleStopModule::plan decreases from 98 to 92 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Method
OutOfLaneModule::plan decreases in cyclomatic complexity from 16 to 14, 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)
✅ No longer an issue: Overall Code Complexity
The mean cyclomatic complexity in this module is no longer above the threshold
Check warning on line 195 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: merge_factors,merge_factors. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check warning on line 294 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
PlanningNode::on_timer increases in cyclomatic complexity from 10 to 14, 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 warning on line 154 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
convert has a cyclomatic complexity of 13, 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 warning on line 114 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
convert has a cyclomatic complexity of 9, 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 warning on line 125 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
convert has 1 complex conditionals with 3 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
Check notice on line 294 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Bumpy Road Ahead
PlanningNode::on_timer increases from 2 to 3 logical blocks with deeply nested code, threshold is one single block per function. 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 warning on line 1 in system/autoware_default_adapi/src/planning.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.50 across 12 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
MotionVelocityPlannerNode::generate_trajectory is no longer above the threshold for cyclomatic complexity. 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)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1084 to 1089, 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 worse: Lines of Code in a Single File
The lines of code increases from 1104 to 1169, 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 worse: Code Duplication
introduced similar code in: reactRTCApprovalByDecisionResult. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
MergeFromPrivateRoadModule::modifyPathVelocity already has high cyclomatic complexity, and now it increases in Lines of Code from 72 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.