Skip to content

fix(raw_vehicle_cmd_converter): fix null check

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Aug 29, 2024 in 36s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.01 (8.25 -> 8.27)

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 2 findings(s) βœ…

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method node.cpp: RawVehicleCommandConverterNode::RawVehicleCommandConverterNode

βœ… Improving Code Health:

  • Complex Method node.cpp: RawVehicleCommandConverterNode::publishActuationCmd
  • Complex Conditional node.cpp: RawVehicleCommandConverterNode::publishActuationCmd

Annotations

Check notice on line 124 in vehicle/autoware_raw_vehicle_cmd_converter/src/node.cpp

See this annotation in the file changed.

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

βœ… Getting better: Complex Method

RawVehicleCommandConverterNode::publishActuationCmd decreases in cyclomatic complexity from 18 to 17, 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 105 in vehicle/autoware_raw_vehicle_cmd_converter/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

RawVehicleCommandConverterNode::RawVehicleCommandConverterNode increases in cyclomatic complexity from 16 to 17, 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 124 in vehicle/autoware_raw_vehicle_cmd_converter/src/node.cpp

See this annotation in the file changed.

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

βœ… Getting better: Complex Conditional

RawVehicleCommandConverterNode::publishActuationCmd decreases from 1 complex conditionals with 3 branches to 1 complex conditionals with 2 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 1 in vehicle/autoware_raw_vehicle_cmd_converter/src/node.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 6.38 to 6.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.