feat(obstacle_cruise_planner): yield function for ocp #6242
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 8 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 0 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):
- Overall Code Complexity node.cpp
- Complex Method node.cpp: ObstacleCruisePlannerNode::findYieldCruiseObstacles
- Complex Method node.cpp: ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles
- Large Method node.cpp: ObstacleCruisePlannerNode::BehaviorDeterminationParam::onParam
- Deep, Nested Complexity node.cpp: ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles
- Deep, Nested Complexity node.cpp: ObstacleCruisePlannerNode::findYieldCruiseObstacles
- Bumpy Road Ahead node.cpp: ObstacleCruisePlannerNode::findYieldCruiseObstacles
- Bumpy Road Ahead node.cpp: ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles
✅ Improving Code Health:
- Primitive Obsession node.cpp
Annotations
Check notice on line 1 in planning/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 1055 to 1201, 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 782 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles increases in cyclomatic complexity from 9 to 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 1000 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
ObstacleCruisePlannerNode::findYieldCruiseObstacles 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 warning on line 329 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
ObstacleCruisePlannerNode::BehaviorDeterminationParam::onParam has 71 lines, 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 1000 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
ObstacleCruisePlannerNode::findYieldCruiseObstacles has 3 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 warning on line 782 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles 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 warning on line 1 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.37 across 43 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.
Check warning on line 782 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Check warning on line 1000 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
ObstacleCruisePlannerNode::findYieldCruiseObstacles has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Check notice on line 1 in planning/obstacle_cruise_planner/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 35.42% to 32.69%, 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.