Skip to content

fix(vehicle_cmd_gate): fix the problems while transition from/to stop…

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Oct 1, 2023 in 38s

CodeScene PR Check

❌ Quality Gates: FAILED

  • Declining Code Health: 3 findings(s) 🚩
  • Improving Code Health: 0 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

🚩 Negative Code Health Impact (highest to lowest):

  • Large Method vehicle_cmd_gate.cpp: VehicleCmdGate::VehicleCmdGate
  • Complex Method vehicle_cmd_gate.cpp: VehicleCmdGate::publishControlCommands
  • Bumpy Road Ahead vehicle_cmd_gate.cpp: VehicleCmdGate::publishControlCommands

Annotations

Check warning on line 447 in control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

VehicleCmdGate::publishControlCommands increases in cyclomatic complexity from 12 to 16, 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 165 in control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

See this annotation in the file changed.

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

❌ Getting worse: Large Method

VehicleCmdGate::VehicleCmdGate increases from 152 to 155 lines of code, 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 447 in control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

VehicleCmdGate::publishControlCommands 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.