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(lane_change): separate path-related function to utils/path #9633

Merged
merged 13 commits into from
Dec 24, 2024

fix error message

8ecae27
Select commit
Loading
Failed to load commit list.
Merged

refactor(lane_change): separate path-related function to utils/path #9633

fix error message
8ecae27
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Dec 24, 2024 in 40s

CodeScene PR Check

Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.71 (5.57 -> 6.28)

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

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Overall Code Complexity path.cpp
  • Complex Method path.cpp: construct_candidate_path
  • Excess Number of Function Arguments path.cpp: get_candidate_path

✅ Improving Code Health:

  • Lines of Code in a Single File scene.cpp 🔥
  • Overall Code Complexity scene.cpp 🔥
  • Overall Code Complexity utils.cpp 🔥
  • Complex Conditional scene.cpp: NormalLaneChange::calcTerminalLaneChangePath 🔥
  • Complex Method utils.cpp: construct_candidate_path 🔥
  • Complex Method scene.cpp: NormalLaneChange::is_collided 🔥
  • Complex Method scene.cpp: NormalLaneChange::calcTerminalLaneChangePath 🔥
  • Bumpy Road Ahead utils.cpp: construct_candidate_path 🔥
  • Excess Number of Function Arguments utils.cpp: construct_candidate_path 🔥
  • 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/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 1610 to 1356, 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 1240 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 worse: Complex Method

NormalLaneChange::check_candidate_path_safety increases in cyclomatic complexity from 12 to 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.

Check notice on line 1624 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)

✅ No longer an issue: Complex Method

NormalLaneChange::is_collided 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 1246 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)

✅ No longer an issue: Complex Method

NormalLaneChange::calcTerminalLaneChangePath 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 1624 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)

ℹ New issue: Complex Method

NormalLaneChange::is_colliding 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.

Check notice on line 1246 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)

✅ No longer an issue: Complex Conditional

NormalLaneChange::calcTerminalLaneChangePath 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 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: Overall Code Complexity

The mean cyclomatic complexity decreases from 4.80 to 4.71, 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 warning on line 291 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/path.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

construct_candidate_path has a cyclomatic complexity of 12, 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 1 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/path.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 4.63 across 8 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 235 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/path.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_candidate_path has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

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 155 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

construct_candidate_path 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 155 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

construct_candidate_path 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 4.89 to 4.80, 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 155 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

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