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(drivable area expansion): do not over expand beyond the desired width #5640

Update docstring and small code cleanup

84fee4e
Select commit
Loading
Failed to load commit list.
Merged

feat(drivable area expansion): do not over expand beyond the desired width #5640

Update docstring and small code cleanup
84fee4e
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Dec 25, 2023 in 37s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 4 findings(s) 🚩
  • Improving Code Health: 5 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method drivable_area_expansion.cpp: calculate_maximum_distance
  • Complex Method drivable_area_expansion.cpp: apply_arc_length_range_smoothing
  • Bumpy Road Ahead drivable_area_expansion.cpp: apply_arc_length_range_smoothing
  • Bumpy Road Ahead drivable_area_expansion.cpp: calculate_maximum_distance

✅ Improving Code Health:

  • Overall Code Complexity drivable_area_expansion.cpp
  • Deep, Nested Complexity drivable_area_expansion.cpp: calculate_minimum_expansions
  • Complex Method drivable_area_expansion.cpp: calculate_minimum_expansions
  • Bumpy Road Ahead drivable_area_expansion.cpp: calculate_minimum_expansions
  • Excess Number of Function Arguments drivable_area_expansion.cpp: calculate_minimum_expansions

Annotations

Check notice on line 194 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.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

calculate_minimum_expansions 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 warning on line 256 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

calculate_maximum_distance 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 178 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

apply_arc_length_range_smoothing has a cyclomatic complexity of 9, 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 194 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.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

calculate_minimum_expansions 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 warning on line 178 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

apply_arc_length_range_smoothing 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 256 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

calculate_maximum_distance 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_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.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 7.78 to 7.50, 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 194 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Deep, Nested Complexity

calculate_minimum_expansions is no longer above the threshold for nested complexity depth. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.

Check notice on line 194 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.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

calculate_minimum_expansions 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 notice on line 194 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.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

calculate_expansion has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.