Skip to content
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Jun 27, 2024 in 52s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 16 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method node.cpp: ObstacleCruisePlannerNode::createSlowDownObstacle
  • Complex Conditional node.cpp: ObstacleCruisePlannerNode::onTrajectory
  • Complex Conditional node.cpp: ObstacleCruisePlannerNode::createSlowDownObstacle
  • Deep, Nested Complexity node.cpp: ObstacleCruisePlannerNode::convertToObstacles
  • Complex Method node.cpp: ObstacleCruisePlannerNode::createStopObstacle
  • Bumpy Road Ahead node.cpp: ObstacleCruisePlannerNode::createSlowDownObstacle
  • Large Method node.cpp: ObstacleCruisePlannerNode::BehaviorDeterminationParam::onParam
  • Complex Conditional node.cpp: ObstacleCruisePlannerNode::createStopObstacle
  • Complex Method node.cpp: ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles
  • Complex Method node.cpp: ObstacleCruisePlannerNode::convertToObstacles
  • Complex Method node.cpp: ObstacleCruisePlannerNode::onTrajectory
  • Deep, Nested Complexity node.cpp: ObstacleCruisePlannerNode::createSlowDownObstacle
  • Complex Method node.cpp: ObstacleCruisePlannerNode::convertToObstacles
  • Complex Method node.cpp: ObstacleCruisePlannerNode::createYieldCruiseObstacle
  • Bumpy Road Ahead node.cpp: ObstacleCruisePlannerNode::createStopObstacle
  • Bumpy Road Ahead node.cpp: ObstacleCruisePlannerNode::convertToObstacles

✅ Improving Code Health:

  • Primitive Obsession node.cpp

Annotations

Check notice on line 1 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Lines of Code in a Single File

The lines of code increases from 1243 to 1458, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.

Check warning on line 1642 in planning/autoware_obstacle_cruise_planner/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

ObstacleCruisePlannerNode::createSlowDownObstacle increases in cyclomatic complexity from 23 to 34, 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 1487 in planning/autoware_obstacle_cruise_planner/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

ObstacleCruisePlannerNode::createStopObstacle increases in cyclomatic complexity from 11 to 18, 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 1028 in planning/autoware_obstacle_cruise_planner/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

ObstacleCruisePlannerNode::determineEgoBehaviorAgainstObstacles increases in cyclomatic complexity from 13 to 15, 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 905 in planning/autoware_obstacle_cruise_planner/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

ObstacleCruisePlannerNode::convertToObstacles increases in cyclomatic complexity from 10 to 15, 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 594 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

ObstacleCruisePlannerNode::onTrajectory has a cyclomatic complexity of 14, 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 1 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

ObstacleCruisePlannerNode::convertToObstacles has a cyclomatic complexity of 10, 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 1122 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

ObstacleCruisePlannerNode::createYieldCruiseObstacle 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 warning on line 555 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Conditional

ObstacleCruisePlannerNode::onTrajectory increases from 1 complex conditionals with 2 branches to 1 complex conditionals with 5 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 warning on line 1394 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

ObstacleCruisePlannerNode::createStopObstacle has 1 complex conditionals with 3 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 warning on line 1508 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

ObstacleCruisePlannerNode::createSlowDownObstacle has 1 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 warning on line 331 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Large Method

ObstacleCruisePlannerNode::BehaviorDeterminationParam::onParam increases from 74 to 89 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 1642 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Bumpy Road Ahead

ObstacleCruisePlannerNode::createSlowDownObstacle increases from 6 to 7 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 warning on line 1487 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Bumpy Road Ahead

ObstacleCruisePlannerNode::createStopObstacle 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 warning on line 905 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

ObstacleCruisePlannerNode::convertToObstacles has 3 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/autoware_obstacle_cruise_planner/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 4.37 to 5.20, 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 905 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

ObstacleCruisePlannerNode::convertToObstacles has a nested complexity depth of 6, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.

Check warning on line 1642 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

ObstacleCruisePlannerNode::createSlowDownObstacle has a nested complexity depth of 4, threshold = 4. 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 1 in planning/autoware_obstacle_cruise_planner/src/node.cpp

See this annotation in the file changed.

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

✅ Getting better: Primitive Obsession

The ratio of primitive types in function arguments decreases from 30.91% to 30.36%, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.

Check notice on line 442 in planning/autoware_obstacle_cruise_planner/src/planner_interface.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Complex Method

PlannerInterface::calculateMarginFromObstacleOnCurve increases in cyclomatic complexity from 11 to 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 notice on line 1 in planning/autoware_obstacle_cruise_planner/src/planner_interface.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.31 to 6.38, 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.