CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 8 findings(s) 🚩
- Improving Code Health: 2 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):
- Complex Method manager.cpp: AvoidanceModuleManager::AvoidanceModuleManager
- Large Method behavior_planning.launch.py: launch_setup
- Complex Method avoidance_module.cpp: AvoidanceModule::generateAvoidOutline 🔥
- Complex Method avoidance_module.cpp: AvoidanceModule::addReturnShiftLine 🔥
- Large Method behavior_path_planner_node.cpp: BehaviorPathPlannerNode::getCommonParam 🔥
- Complex Method behavior_path_planner_node.cpp: BehaviorPathPlannerNode::BehaviorPathPlannerNode 🔥
- Complex Method utils.cpp: isTrafficSignalStop 🔥
- Bumpy Road Ahead utils.cpp: calcDistanceToReturnDeadLine 🔥
✅ Improving Code Health:
- Overall Code Complexity utils.cpp 🔥
- Overall Code Complexity behavior_path_planner_node.cpp 🔥
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
launch_setup increases from 213 to 217 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 112 in planning/behavior_path_planner/src/behavior_path_planner_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
BehaviorPathPlannerNode::BehaviorPathPlannerNode already has high cyclomatic complexity, and now it increases in Lines of Code from 162 to 166. 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 284 in planning/behavior_path_planner/src/behavior_path_planner_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
BehaviorPathPlannerNode::getCommonParam increases from 104 to 105 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 notice on line 1 in planning/behavior_path_planner/src/behavior_path_planner_node.cpp
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 notice on line 1 in planning/behavior_path_planner/src/utils/avoidance/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 1380 to 1493, 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 280 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
isTrafficSignalStop has a cyclomatic complexity of 10, 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 1982 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
calcDistanceToReturnDeadLine has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested 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 notice on line 1 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.43 to 5.39, 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 warning on line 238 in planning/behavior_path_planner/src/scene_module/avoidance/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
AvoidanceModuleManager::AvoidanceModuleManager already has high cyclomatic complexity, and now it increases in Lines of Code from 245 to 253. 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 2175 to 2190, 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: Complex Method
AvoidanceModule::generateAvoidOutline increases in cyclomatic complexity from 41 to 43, 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)
❌ Getting worse: Complex Method
AvoidanceModule::addReturnShiftLine already has high cyclomatic complexity, and now it increases in Lines of Code from 135 to 137. 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: Overall Code Complexity
The mean cyclomatic complexity increases from 6.08 to 6.11, 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.