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(out_of_lane): more stable decisions #5197

Merge branch 'main' into feat/out_of_lane-more_stable-universe

990b48f
Select commit
Loading
Failed to load commit list.
Merged

feat(out_of_lane): more stable decisions #5197

Merge branch 'main' into feat/out_of_lane-more_stable-universe
990b48f
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Nov 15, 2023 in 35s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 10 findings(s) 🚩
  • Improving Code Health: 1 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 scene_out_of_lane.cpp: OutOfLaneModule::modifyPathVelocity
  • Complex Conditional scene_out_of_lane.cpp: OutOfLaneModule::modifyPathVelocity
  • Complex Method decisions.cpp: object_time_to_range
  • Large Method debug.cpp: add_range_markers
  • Complex Method decisions.cpp: object_time_to_range
  • Excess Number of Function Arguments decisions.cpp: object_time_to_range
  • Bumpy Road Ahead debug.cpp: add_range_markers
  • Excess Number of Function Arguments debug.cpp: add_range_markers
  • Excess Number of Function Arguments debug.cpp: add_current_overlap_marker
  • Excess Number of Function Arguments debug.cpp: add_lanelet_markers

✅ Improving Code Health:

  • Large Method scene_out_of_lane.cpp: OutOfLaneModule::modifyPathVelocity

Annotations

Check warning on line 184 in planning/behavior_velocity_out_of_lane_module/src/debug.cpp

See this annotation in the file changed.

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

❌ New issue: Large Method

add_range_markers has 71 lines, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.

Check warning on line 184 in planning/behavior_velocity_out_of_lane_module/src/debug.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

add_range_markers 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 87 in planning/behavior_velocity_out_of_lane_module/src/debug.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

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

Check warning on line 112 in planning/behavior_velocity_out_of_lane_module/src/debug.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

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

Check warning on line 184 in planning/behavior_velocity_out_of_lane_module/src/debug.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

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

Check warning on line 1 in planning/behavior_velocity_out_of_lane_module/src/decisions.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

object_time_to_range already has high cyclomatic complexity, and now it increases in Lines of Code from 71 to 72. 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 75 in planning/behavior_velocity_out_of_lane_module/src/decisions.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

object_time_to_range already has high cyclomatic complexity, and now it increases in Lines of Code from 71 to 72. 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_velocity_out_of_lane_module/src/decisions.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Overall Code Complexity

The mean cyclomatic complexity increases from 5.57 to 5.62, 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 75 in planning/behavior_velocity_out_of_lane_module/src/decisions.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

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

Check warning on line 176 in planning/behavior_velocity_out_of_lane_module/src/scene_out_of_lane.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

OutOfLaneModule::modifyPathVelocity has a cyclomatic complexity of 21, 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 148 in planning/behavior_velocity_out_of_lane_module/src/scene_out_of_lane.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

OutOfLaneModule::modifyPathVelocity has 2 complex conditionals with 4 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 176 in planning/behavior_velocity_out_of_lane_module/src/scene_out_of_lane.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Bumpy Road Ahead

OutOfLaneModule::modifyPathVelocity increases from 2 to 3 logical blocks with deeply nested code, threshold is one single 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 176 in planning/behavior_velocity_out_of_lane_module/src/scene_out_of_lane.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Large Method

OutOfLaneModule::modifyPathVelocity is no longer above the threshold for lines of code