feat(intersection): publish and visualize the reason for dangerous situation to blame past detection fault retrospectively #6143
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 22 findings(s) 🚩
- Improving Code Health: 19 findings(s) ✅
- Affected Hotspots: 1 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 Conditional scene_intersection_collision.cpp: IntersectionModule::generateDetectionBlameDiagnosis
- Complex Method scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Complex Method scene_intersection_collision.cpp: IntersectionModule::updateObjectInfoManagerCollision
- Overall Code Complexity scene_intersection_collision.cpp
- Complex Method scene_intersection_prepare_data.cpp: IntersectionModule::generateIntersectionStopLines
- Complex Method scene_intersection_collision.cpp: IntersectionModule::calcIntersectionPassingTime
- Overall Function Size scene_intersection_collision.cpp
- Complex Method scene_intersection.cpp: IntersectionModule::isOverPassJudgeLinesStatus 🔥
- Complex Method scene_intersection_collision.cpp: IntersectionModule::detectCollision
- Complex Method scene_intersection_collision.cpp: IntersectionModule::generateDetectionBlameDiagnosis
- Complex Method scene_intersection_prepare_data.cpp: IntersectionModule::prepareIntersectionData
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::detectCollision
- Complex Method decision_result.cpp: formatDecisionResult
- Complex Method scene_intersection_collision.cpp: IntersectionModule::updateObjectInfoManagerArea
- Complex Conditional object_manager.cpp: ObjectInfo::can_stop_before_ego_lane
- Complex Method scene_intersection_collision.cpp: IntersectionModule::generateEgoRiskEvasiveDiagnosis
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::updateObjectInfoManagerCollision
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::generateDetectionBlameDiagnosis
- Complex Conditional scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Bumpy Road Ahead object_manager.cpp: findPassageInterval
- Excess Number of Function Arguments object_manager.cpp: ObjectInfoManager::registerExistingObject
- Excess Number of Function Arguments object_manager.cpp: findPassageInterval
✅ Improving Code Health:
- Complex Method scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Bumpy Road Ahead scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Complex Method debug.cpp: IntersectionModule::createDebugMarkerArray
- Lines of Code in a Single File scene_intersection.cpp 🔥
- Overall Code Complexity scene_intersection.cpp 🔥
- Brain Method scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Complex Conditional scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Complex Method scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Complex Method scene_intersection.cpp: IntersectionModule::generateTargetObjects 🔥
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::isGreenPseudoCollisionStatus
- Deep, Nested Complexity scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Deep, Nested Complexity scene_intersection_collision.cpp: IntersectionModule::cutPredictPathWithDuration
- Excess Number of Function Arguments scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Excess Number of Function Arguments scene_intersection_collision.cpp: IntersectionModule::calcIntersectionPassingTime
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::generateTargetObjects 🔥
- Overall Code Complexity debug.cpp
- Brain Method scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Excess Number of Function Arguments scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
Annotations
Check warning on line 152 in planning/behavior_velocity_intersection_module/src/object_manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
ObjectInfo::can_stop_before_ego_lane 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 307 in planning/behavior_velocity_intersection_module/src/object_manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
findPassageInterval 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 233 in planning/behavior_velocity_intersection_module/src/object_manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
ObjectInfoManager::registerExistingObject has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 307 in planning/behavior_velocity_intersection_module/src/object_manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
findPassageInterval 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: Overall Function Size
The median function size in this module is 59.0 LOC, threshold = 50.0. This file contains overly long functions, measured by their lines of code.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Brain Method
IntersectionModule::checkCollision is no longer a brain method. A Brain Method -- aka a God Function -- is a large and complex function that centralizes the behavior of a module. Brain Methods are detected using a combination of the following code smells: Deeply Nested Logic + High Cyclomatic Complexity + Many Lines of Code + Many Function Arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Brain Method
IntersectionModule::updateObjectInfoManagerCollision is a brain method. A Brain Method -- aka a God Function -- is a large and complex function that centralizes the behavior of a module. Brain Methods are detected using a combination of the following code smells: Deeply Nested Logic + High Cyclomatic Complexity + Many Lines of Code + Many Function Arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
IntersectionModule::calcIntersectionPassingTime increases in cyclomatic complexity from 22 to 26, 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: Complex Method
IntersectionModule::checkCollision 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)
❌ New issue: Complex Method
IntersectionModule::updateObjectInfoManagerCollision has a cyclomatic complexity of 34, 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
IntersectionModule::detectCollision 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
IntersectionModule::generateDetectionBlameDiagnosis 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
IntersectionModule::updateObjectInfoManagerArea 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
IntersectionModule::generateEgoRiskEvasiveDiagnosis 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)
✅ No longer an issue: Complex Conditional
IntersectionModule::checkCollision 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
IntersectionModule::generateDetectionBlameDiagnosis has 3 complex conditionals with 6 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
IntersectionModule::checkCollision 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)
✅ No longer an issue: Bumpy Road Ahead
IntersectionModule::isGreenPseudoCollisionStatus 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)
❌ New issue: Bumpy Road Ahead
IntersectionModule::detectCollision has 5 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
IntersectionModule::updateObjectInfoManagerCollision 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
IntersectionModule::generateDetectionBlameDiagnosis 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)
❌ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 13.71 to 14.10, 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)
✅ No longer an issue: Deep, Nested Complexity
IntersectionModule::checkCollision is no longer above the threshold for nested complexity depth. 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)
✅ No longer an issue: Deep, Nested Complexity
IntersectionModule::cutPredictPathWithDuration is no longer above the threshold for nested complexity depth. 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: Deep, Nested Complexity
IntersectionModule::updateObjectInfoManagerCollision 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.