Skip to content

Correctly use the max expansion distance when smoothing over arc lengths

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) succeeded Dec 18, 2023 in 46s

CodeScene PR Check

βœ… Code Health Quality Gates: OK

  • Declining Code Health: 0 findings(s) 🚩
  • Improving Code Health: 5 findings(s) βœ…
  • Affected Hotspots: 0 files(s) πŸ”₯

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

Details

βœ… Improving Code Health:

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

Annotations

Check notice on line 196 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 notice on line 180 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_extra_arc_length 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 196 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 notice on line 180 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_extra_arc_length 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 6.92, 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 196 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 196 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 196 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.