feat(intersection): ignore decelerating vehicle on amber traffic light #5304
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 8 findings(s) 🚩
- Improving Code Health: 8 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 Method scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Complex Method util.cpp: getObjectiveLanelets
- Bumpy Road Ahead util.cpp: getObjectiveLanelets
- Complex Method scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Complex Method debug.cpp: IntersectionModule::createDebugMarkerArray
- Complex Method util.cpp: mergeLaneletsByTopologicalSort
- Bumpy Road Ahead util.cpp: mergeLaneletsByTopologicalSort
- Complex Method scene_intersection.cpp: IntersectionModule::generateTargetObjects 🔥
✅ Improving Code Health:
- Complex Method scene_intersection.cpp: IntersectionModule::isOcclusionCleared 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::filterTargetObjects 🔥
- Overall Code Complexity util.cpp
- Complex Method util.cpp: generateDetectionLaneDivisions
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::filterTargetObjects 🔥
- Deep, Nested Complexity scene_intersection.cpp: IntersectionModule::isOcclusionCleared 🔥
- Bumpy Road Ahead util.cpp: generateDetectionLaneDivisions
- Excess Number of Function Arguments util.cpp: checkAngleForTargetLanelets
Annotations
Check notice on line 1 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1598 to 1625, 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 1 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 7.43 to 7.68, 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)
ℹ Getting worse: Bumpy Road Ahead
IntersectionModule::checkCollision increases from 3 to 4 logical blocks with deeply nested code, threshold is one single 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)
✅ No longer an issue: Bumpy Road Ahead
IntersectionModule::filterTargetObjects 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::generateTargetObjects 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)
❌ Getting worse: Complex Method
IntersectionModule::modifyPathVelocityDetail increases in cyclomatic complexity from 69 to 71, 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 better: Complex Method
IntersectionModule::isOcclusionCleared decreases in cyclomatic complexity from 65 to 63, 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
IntersectionModule::checkCollision increases in cyclomatic complexity from 21 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::filterTargetObjects 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::generateTargetObjects has a cyclomatic complexity of 14, 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 better: Deep, Nested Complexity
IntersectionModule::isOcclusionCleared decreases in nested complexity depth from 5 to 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/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1127 to 1179, 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 850 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
getObjectiveLanelets increases in cyclomatic complexity from 38 to 49, 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 1072 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
generateDetectionLaneDivisions 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 666 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
mergeLaneletsByTopologicalSort 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 850 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Bumpy Road Ahead
getObjectiveLanelets increases from 10 to 12 logical blocks with deeply nested code, threshold is one single 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 1072 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Bumpy Road Ahead
generateDetectionLaneDivisions decreases from 8 to 3 logical blocks with deeply nested code, threshold is one single 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 666 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
mergeLaneletsByTopologicalSort 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.
Check notice on line 1 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 7.20 to 7.19, 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 notice on line 1266 in planning/behavior_velocity_intersection_module/src/util.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Excess Number of Function Arguments
checkAngleForTargetLanelets decreases from 7 to 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 240 in planning/behavior_velocity_intersection_module/src/debug.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
IntersectionModule::createDebugMarkerArray already has high cyclomatic complexity, and now it increases in Lines of Code from 98 to 102. 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.