Skip to content

fix and code cleanup (working)

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Dec 6, 2024 in 49s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.05 (8.65 -> 8.70)

  • Declining Code Health: 3 findings(s) 🚩

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method out_of_lane_module.cpp: OutOfLaneModule::plan
  • Deep, Nested Complexity planner_data.cpp: PlannerData::calculate_map_stop_points
  • Complex Method calculate_slowdown_points.cpp: calculate_slowdown_point

Annotations

Check warning on line 228 in planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/out_of_lane_module.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

OutOfLaneModule::plan already has high cyclomatic complexity, and now it increases in Lines of Code from 130 to 131. 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 88 in planning/motion_velocity_planner/autoware_motion_velocity_planner_common/src/planner_data.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

PlannerData::calculate_map_stop_points 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.

Check warning on line 140 in planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/calculate_slowdown_points.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

calculate_slowdown_point 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.