Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(topic_state_monitor): rework parameter #8938

test(bpp_common): add test for objects filtering except for lanelet u…

7ae5598
Select commit
Loading
Failed to load commit list.
Closed

refactor(topic_state_monitor): rework parameter #8938

test(bpp_common): add test for objects filtering except for lanelet u…
7ae5598
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Oct 16, 2024 in 1m 10s

CodeScene PR Check

Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.13 (6.93 -> 7.06)

  • Declining Code Health: 15 findings(s) 🚩
  • Improving Code Health: 8 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

Absence of Expected Change Pattern

  • autoware.universe/evaluator/perception_online_evaluator/src/metrics_calculator.cpp is usually changed with: autoware.universe/evaluator/perception_online_evaluator/test/test_perception_online_evaluator_node.cpp
  • 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
  • Large Method vehicle_cmd_gate.cpp: VehicleCmdGate::VehicleCmdGate
  • Complex Method vehicle_cmd_gate.cpp: VehicleCmdGate::onTimer
  • Code Duplication test_freespace_planner_utils.cpp
  • Overall Code Complexity utils.cpp
  • Large Method test_utils.cpp: TEST:NoStoppingAreaTest:generateEgoNoStoppingAreaLanePolygon
  • Complex Method node.cpp: SurroundObstacleCheckerNode::onTimer
  • Complex Method utils.cpp: generate_ego_no_stopping_area_lane_polygon
  • Missing Arguments Abstractions utils.cpp
  • Bumpy Road Ahead test_freespace_planner_utils.cpp: get_trajectory
  • Bumpy Road Ahead test_freespace_planner_utils.cpp: get_waypoints
  • 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:

  • Lines of Code in a Single File scene.cpp 🔥
  • Primitive Obsession path_shifter.cpp
  • 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

Check notice on line 121 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/debug.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 121 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/debug.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 167 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 205 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 205 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

✅ No longer an issue: Complex Conditional

NoStoppingAreaModule::isTargetStuckVehicleType no longer has a complex conditional

Check notice on line 178 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 205 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 205 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 1 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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

Check warning on line 204 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 204 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 127 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 204 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 260 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/src/utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 354 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/test/test_utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 438 in planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module/test/test_utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check notice on line 1 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/scene.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Lines of Code in a Single File

The lines of code decreases from 1708 to 1707, 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_path_planner/autoware_behavior_path_planner_common/src/utils/path_shifter/path_shifter.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Primitive Obsession

The ratio of primitive types in function arguments decreases from 74.36% to 58.33%, 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 381 in control/autoware_vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

VehicleCmdGate::onTimer already has high cyclomatic complexity, and now it increases in Lines of Code from 113 to 114. 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 81 in control/autoware_vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

VehicleCmdGate::VehicleCmdGate increases from 142 to 144 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.

Check warning on line 269 in planning/autoware_surround_obstacle_checker/src/node.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

SurroundObstacleCheckerNode::onTimer already has high cyclomatic complexity, and now it increases in Lines of Code from 85 to 91. 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 204 in perception/autoware_object_merger/src/object_association_merger_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Complex Method

ObjectAssociationMergerNode::objectsCallback already has high cyclomatic complexity, and now it increases in Lines of Code from 91 to 93. 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 69 in planning/autoware_freespace_planner/test/test_freespace_planner_utils.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Code Duplication

The module contains 2 functions with similar structure: get_trajectory,get_waypoints. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.