Skip to content

feat(goal_planner): move goal_candidates from ThreadSafeData to GoalP…

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Nov 11, 2024 in 41s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

Change in average Code Health of affected files: -0.07 (3.66 -> 3.59)

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

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Conditional goal_planner_module.cpp: GoalPlannerModule::onFreespaceParkingTimer πŸ”₯
  • Complex Method goal_planner_module.cpp: GoalPlannerModule::onTimer πŸ”₯
  • Complex Method goal_searcher.cpp: GoalSearcher::search
  • Complex Method goal_planner_module.cpp: GoalPlannerModule::onFreespaceParkingTimer πŸ”₯
  • Complex Method goal_searcher.cpp: GoalSearcher::update

βœ… Improving Code Health:

  • Lines of Code in a Single File goal_planner_module.cpp πŸ”₯
  • Complex Method goal_planner_module.cpp: GoalPlannerModule::updateData πŸ”₯
  • Bumpy Road Ahead goal_planner_module.cpp: GoalPlannerModule::updateData πŸ”₯

Annotations

Check notice on line 1 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

See this annotation in the file changed.

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

βœ… Getting better: Lines of Code in a Single File

The lines of code decreases from 2018 to 2012, 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 300 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

GoalPlannerModule::onTimer already has high cyclomatic complexity, and now it increases in Lines of Code from 138 to 139. 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 448 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

GoalPlannerModule::onFreespaceParkingTimer increases in cyclomatic complexity from 15 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 notice on line 598 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

See this annotation in the file changed.

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

βœ… Getting better: Complex Method

GoalPlannerModule::updateData decreases in cyclomatic complexity from 16 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 408 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Conditional

GoalPlannerModule::onFreespaceParkingTimer increases from 2 complex conditionals with 5 branches to 2 complex conditionals with 6 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 598 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

See this annotation in the file changed.

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

βœ… Getting better: Bumpy Road Ahead

GoalPlannerModule::updateData decreases from 3 to 2 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 176 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_searcher.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

GoalSearcher::search increases in cyclomatic complexity from 21 to 22, 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 326 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_searcher.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

GoalSearcher::update increases in cyclomatic complexity from 9 to 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 notice on line 1 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_searcher.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.64 to 5.79, 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.