feat(dynamic_avoidance): avoid pedestrians #6553
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 18 findings(s) 🚩
- Improving Code Health: 6 findings(s) ✅
- Affected Hotspots: 1 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Complex Conditional scene.cpp: DynamicAvoidanceModule::determineWhetherToAvoidAgainstRegulatedObjects 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::determineWhetherToAvoidAgainstRegulatedObjects 🔥
- Large Method manager.cpp: DynamicAvoidanceModuleManager::updateModuleParams
- Large Method manager.cpp: DynamicAvoidanceModuleManager::init
- Complex Method scene.cpp: DynamicAvoidanceModule::registerRegulatedObjects 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidRegulatedObject 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::getObjectType 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidUnregulatedObject 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::registerUnregulatedObjects 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::calcPredictedPathBasedDynamicObstaclePolygon 🔥
- Complex Conditional scene.cpp: DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidRegulatedObject 🔥
- Complex Conditional scene.cpp: DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidUnregulatedObject 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::determineWhetherToAvoidAgainstUnregulatedObjects 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::plan 🔥
- Bumpy Road Ahead scene.cpp: DynamicAvoidanceModule::registerRegulatedObjects 🔥
- Bumpy Road Ahead scene.cpp: DynamicAvoidanceModule::registerUnregulatedObjects 🔥
- Bumpy Road Ahead scene.cpp: DynamicAvoidanceModule::determineWhetherToAvoidAgainstRegulatedObjects 🔥
- Bumpy Road Ahead scene.cpp: DynamicAvoidanceModule::calcPredictedPathBasedDynamicObstaclePolygon 🔥
✅ Improving Code Health:
- Complex Conditional scene.cpp: DynamicAvoidanceModule::updateTargetObjects 🔥
- Complex Conditional scene.cpp: DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoid 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::updateTargetObjects 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoid 🔥
- Complex Method scene.cpp: DynamicAvoidanceModule::isLabelTargetObstacle 🔥
- Bumpy Road Ahead scene.cpp: DynamicAvoidanceModule::updateTargetObjects 🔥
Annotations
Check notice on line 1 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1163 to 1461, 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 870 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
DynamicAvoidanceModule::updateTargetObjects 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.
Check notice on line 1382 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoid 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.
Check notice on line 487 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
DynamicAvoidanceModule::isLabelTargetObstacle 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.
Check warning on line 810 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::determineWhetherToAvoidAgainstRegulatedObjects has a cyclomatic complexity of 30, 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 576 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::registerRegulatedObjects has a cyclomatic complexity of 19, 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 1382 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidRegulatedObject 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 487 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::getObjectType 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 1556 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidUnregulatedObject 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 650 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::registerUnregulatedObjects 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 1781 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::calcPredictedPathBasedDynamicObstaclePolygon 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.
Check warning on line 870 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::determineWhetherToAvoidAgainstUnregulatedObjects 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 443 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DynamicAvoidanceModule::plan 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 notice on line 1 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
DynamicAvoidanceModule::updateTargetObjects no longer has a complex conditional. 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 1 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoid no longer has a complex conditional. 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 warning on line 1 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
DynamicAvoidanceModule::determineWhetherToAvoidAgainstRegulatedObjects has 2 complex conditionals with 5 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 warning on line 1 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidRegulatedObject has 1 complex conditionals with 2 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 warning on line 1483 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
DynamicAvoidanceModule::calcMinMaxLateralOffsetToAvoidUnregulatedObject has 1 complex conditionals with 2 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 870 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
DynamicAvoidanceModule::updateTargetObjects 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.
Check warning on line 576 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
DynamicAvoidanceModule::registerRegulatedObjects 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 650 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
DynamicAvoidanceModule::registerUnregulatedObjects 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 810 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
DynamicAvoidanceModule::determineWhetherToAvoidAgainstRegulatedObjects 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 1781 in planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
DynamicAvoidanceModule::calcPredictedPathBasedDynamicObstaclePolygon 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_dynamic_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 6.13 to 6.47, 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 250 in planning/behavior_path_dynamic_avoidance_module/src/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
DynamicAvoidanceModuleManager::updateModuleParams increases from 112 to 121 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.