feat(predicted_path_checker): check predicted trajectory to avoid collisions planning can not handle #2528
CodeScene PR Check
❌ Quality Gates: FAILED
- Declining Code Health: 21 findings(s) 🚩
- Improving Code Health: 0 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
🚩 Negative Code Health Impact (highest to lowest):
- Large Method control.launch.py: launch_setup
- Complex Method debug_marker.cpp: PredictedPathCheckerDebugNode::makeVisualizationMarker
- Deep, Nested Complexity collision_checker.cpp: CollisionChecker::checkDynamicObjects
- Bumpy Road Ahead debug_marker.cpp: PredictedPathCheckerDebugNode::makeVisualizationMarker
- Overall Code Complexity debug_marker.cpp
- Deep, Nested Complexity debug_marker.cpp: PredictedPathCheckerDebugNode::makeVisualizationMarker
- Complex Method collision_checker.cpp: CollisionChecker::checkDynamicObjects
- Complex Method predicted_path_checker_node.cpp: PredictedPathCheckerNode::onTimer
- Complex Method predicted_path_checker_node.cpp: PredictedPathCheckerNode::filterObstacles
- Excess Number of Function Arguments collision_checker.cpp: CollisionChecker::checkDynamicObjects
- Excess Number of Function Arguments predicted_path_checker_node.cpp: PredictedPathCheckerNode::filterObstacles
- Primitive Obsession utils.cpp
- Excess Number of Function Arguments utils.cpp: isInBrakeDistance
- Complex Method collision_checker.cpp: CollisionChecker::checkObstacleHistory
- Complex Method collision_checker.cpp: CollisionChecker::checkTrajectoryForCollision
- Complex Method predicted_path_checker_node.cpp: PredictedPathCheckerNode::isDataReady
- Bumpy Road Ahead collision_checker.cpp: CollisionChecker::checkDynamicObjects
- Bumpy Road Ahead predicted_path_checker_node.cpp: PredictedPathCheckerNode::onTimer
- Bumpy Road Ahead predicted_path_checker_node.cpp: PredictedPathCheckerNode::filterObstacles
- Bumpy Road Ahead collision_checker.cpp: CollisionChecker::checkTrajectoryForCollision
- Bumpy Road Ahead collision_checker.cpp: CollisionChecker::checkObstacleHistory
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
CollisionChecker::checkDynamicObjects has a cyclomatic complexity of 16, 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
CollisionChecker::checkObstacleHistory has a cyclomatic complexity of 11, 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
CollisionChecker::checkTrajectoryForCollision has a cyclomatic complexity of 11, 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: Bumpy Road Ahead
CollisionChecker::checkDynamicObjects has 4 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
CollisionChecker::checkTrajectoryForCollision 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
CollisionChecker::checkObstacleHistory 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
CollisionChecker::checkDynamicObjects 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
CollisionChecker::checkDynamicObjects has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PredictedPathCheckerDebugNode::makeVisualizationMarker has a cyclomatic complexity of 21, 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: Bumpy Road Ahead
PredictedPathCheckerDebugNode::makeVisualizationMarker has 6 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.90 across 10 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)
❌ New issue: Deep, Nested Complexity
PredictedPathCheckerDebugNode::makeVisualizationMarker 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PredictedPathCheckerNode::onTimer has a cyclomatic complexity of 12, 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
PredictedPathCheckerNode::filterObstacles 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PredictedPathCheckerNode::isDataReady 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
PredictedPathCheckerNode::onTimer 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
PredictedPathCheckerNode::filterObstacles 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
PredictedPathCheckerNode::filterObstacles has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 1 in control/predicted_path_checker/src/predicted_path_checker_node/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Primitive Obsession
In this module, 30.2% of all function arguments are primitive types, 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 1 in control/predicted_path_checker/src/predicted_path_checker_node/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
isInBrakeDistance has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 371 in launch/tier4_control_launch/launch/control.launch.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
launch_setup increases from 282 to 310 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.