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

feat(lane_change): improve delay lane change logic #9480

Merged

Update planning/behavior_path_planner/autoware_behavior_path_lane_cha…

c7c2093
Select commit
Loading
Failed to load commit list.
Merged

feat(lane_change): improve delay lane change logic #9480

Update planning/behavior_path_planner/autoware_behavior_path_lane_cha…
c7c2093
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Nov 27, 2024 in 47s

CodeScene PR Check

Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.19 (6.28 -> 6.47)

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

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method manager.cpp: LaneChangeModuleManager::set_params

✅ Improving Code Health:

  • Lines of Code in a Single File scene.cpp 🔥
  • Overall Code Complexity utils.cpp 🔥
  • Complex Conditional utils.cpp: passed_parked_objects 🔥
  • Complex Method utils.cpp: getLeadingStaticObjectIdx 🔥
  • Complex Method utils.cpp: passed_parked_objects 🔥
  • Complex Method utils.cpp: isParkedObject 🔥
  • Bumpy Road Ahead utils.cpp: isParkedObject 🔥
  • Excess Number of Function Arguments utils.cpp: getLeadingStaticObjectIdx 🔥
  • Lines of Code in a Single File utils.cpp 🔥

Annotations

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

See this annotation in the file changed.

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

✅ No longer an issue: Lines of Code in a Single File

The lines of code in this module is no longer above the threshold

Check notice on line 800 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.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

getLeadingStaticObjectIdx 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 769 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.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

passed_parked_objects 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 697 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.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

isParkedObject 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 800 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

See this annotation in the file changed.

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

ℹ New issue: Complex Method

is_delay_lane_change 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 notice on line 749 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.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

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

Check notice on line 750 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

See this annotation in the file changed.

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

ℹ New issue: Complex Conditional

is_delay_lane_change 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 notice on line 697 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.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

isParkedObject 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 1 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

See this annotation in the file changed.

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

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 5.09 to 4.88, 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 800 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Excess Number of Function Arguments

getLeadingStaticObjectIdx is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 208 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/manager.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

LaneChangeModuleManager::set_params already has high cyclomatic complexity, and now it increases in Lines of Code from 193 to 196. 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 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 1607 to 1606, 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.