test(no_stopping_area): refactor and add tests #9009
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.36 (8.59 -> 8.95)
- Declining Code Health: 9 findings(s) 🚩
- Improving Code Health: 6 findings(s) ✅
View detailed results in CodeScene
Absence of Expected Change Pattern
- autoware.universe/planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/manager.cpp is usually changed with: autoware.universe/planning/behavior_velocity_planner/autoware_behavior_velocity_detection_area_module/src/manager.cpp
Details
🚩 Declining Code Health (highest to lowest):
- Large Assertion Blocks test_utils.cpp
- Overall Code Complexity utils.cpp
- Large Method test_utils.cpp: TEST:NoStoppingAreaTest:generateEgoNoStoppingAreaLanePolygon
- Complex Method utils.cpp: generate_ego_no_stopping_area_lane_polygon
- Missing Arguments Abstractions utils.cpp
- Bumpy Road Ahead utils.cpp: generate_ego_no_stopping_area_lane_polygon
- Excess Number of Function Arguments utils.cpp: generate_ego_no_stopping_area_lane_polygon
- Excess Number of Function Arguments utils.cpp: is_stoppable
- Excess Number of Function Arguments utils.cpp: get_stop_line_geometry2d
✅ Improving Code Health:
- Complex Method scene_no_stopping_area.cpp: NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon
- Bumpy Road Ahead debug.cpp: createLaneletInfoMarkerArray
- Bumpy Road Ahead scene_no_stopping_area.cpp: NoStoppingAreaModule::checkStuckVehiclesInNoStoppingArea
- Bumpy Road Ahead scene_no_stopping_area.cpp: NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon
- Complex Conditional scene_no_stopping_area.cpp: NoStoppingAreaModule::isTargetStuckVehicleType
- Overall Code Complexity scene_no_stopping_area.cpp
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
createLaneletInfoMarkerArray 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
create_lanelet_info_marker_array 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
NoStoppingAreaModule::modifyPathVelocity already has high cyclomatic complexity, and now it increases in Lines of Code from 93 to 99. 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
NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon 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)
✅ No longer an issue: Complex Conditional
NoStoppingAreaModule::isTargetStuckVehicleType no longer has a complex conditional
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
NoStoppingAreaModule::checkStuckVehiclesInNoStoppingArea 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
NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon 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
NoStoppingAreaModule::check_stuck_vehicles_in_no_stopping_area 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)
✅ No longer an issue: Overall Code Complexity
The mean cyclomatic complexity in this module is no longer above the threshold
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
generate_ego_no_stopping_area_lane_polygon 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
generate_ego_no_stopping_area_lane_polygon 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: Overall Code Complexity
This module has a mean cyclomatic complexity of 5.57 across 7 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: Missing Arguments Abstractions
The average number of function arguments in this module is 4.14 across 7 functions. The average arguments threshold is 4.00. The functions in this file have too many arguments, indicating a lack of encapsulation or too many responsibilities in the same functions. Avoid adding more.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
is_stoppable has 6 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: Excess Number of Function Arguments
generate_ego_no_stopping_area_lane_polygon has 8 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: Excess Number of Function Arguments
get_stop_line_geometry2d 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: Large Method
TEST:NoStoppingAreaTest:generateEgoNoStoppingAreaLanePolygon has 103 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Assertion Blocks
The test suite contains 5 assertion blocks with at least 4 assertions, threshold = 4. This test file has several blocks of large, consecutive assert statements. Avoid adding more.