Skip to content
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Feb 28, 2024 in 2m 39s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 18 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅
  • Affected Hotspots: 3 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):

  • Code Duplication signal_display.cpp
  • Overall Code Complexity lanelet2_map_loader_node.cpp
  • Deep, Nested Complexity lanelet2_map_loader_node.cpp: Lanelet2MapLoaderNode::getLanelet2Paths
  • Complex Method behavior_path_planner_node.cpp: BehaviorPathPlannerNode::run 🔥
  • Complex Method utils.cpp: isEgoOutOfRoute 🔥
  • Large Method overlay_text_display.cpp: OverlayTextDisplay::OverlayTextDisplay
  • Complex Method overlay_text_display.cpp: OverlayTextDisplay::processMessage
  • Complex Method route_handler.cpp: RouteHandler::setLaneletsFromRouteMsg 🔥
  • Complex Method lanelet2_differential_loader_module.cpp: Lanelet2DifferentialLoaderModule::differentialLanelet2Load
  • Complex Method overlay_text_display.cpp: OverlayTextDisplay::update
  • Complex Method gear_display.cpp: GearDisplay::drawGearIndicator
  • Complex Conditional overlay_utils.cpp: OverlayObject::updateTextureSize
  • Complex Method dynamic_lanelet_provider.cpp: DynamicLaneletProviderNode::updateMap
  • Complex Method lanelet2_differential_loader_module.cpp: Lanelet2DifferentialLoaderModule::loadWholeMap
  • Bumpy Road Ahead dynamic_lanelet_provider.cpp: DynamicLaneletProviderNode::updateMap
  • Bumpy Road Ahead lanelet2_differential_loader_module.cpp: Lanelet2DifferentialLoaderModule::loadWholeMap
  • Bumpy Road Ahead lanelet2_differential_loader_module.cpp: Lanelet2DifferentialLoaderModule::differentialLanelet2Load
  • Bumpy Road Ahead lanelet2_map_loader_node.cpp: Lanelet2MapLoaderNode::getLanelet2Paths

✅ Improving Code Health:

  • Large Method manager.cpp: StartPlannerModuleManager::updateModuleParams

Annotations

Check warning on line 356 in planning/behavior_path_planner/src/behavior_path_planner_node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

BehaviorPathPlannerNode::run already has high cyclomatic complexity, and now it increases in Lines of Code from 95 to 96. 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_common/src/utils/utils.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 1275 to 1286, 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 notice on line 1 in planning/behavior_path_planner_common/src/utils/utils.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.47 to 4.53, 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 notice on line 518 in planning/behavior_path_planner_common/src/utils/utils.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Bumpy Road Ahead

isEgoOutOfRoute 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 518 in planning/behavior_path_planner_common/src/utils/utils.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

isEgoOutOfRoute increases in cyclomatic complexity from 14 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 1 in planning/route_handler/src/route_handler.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 1911 to 1931, 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 381 in planning/route_handler/src/route_handler.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

RouteHandler::setLaneletsFromRouteMsg increases in cyclomatic complexity from 11 to 13, 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/route_handler/src/route_handler.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.47 to 4.49, 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 225 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_loader_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

Lanelet2MapLoaderNode::getLanelet2Paths 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 1 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_loader_node.cpp

See this annotation in the file changed.

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

❌ New issue: Overall Code Complexity

This module has a mean cyclomatic complexity of 4.43 across 7 functions. The mean complexity threshold is 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 225 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_loader_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

Lanelet2MapLoaderNode::getLanelet2Paths 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 warning on line 97 in common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/gear_display.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

GearDisplay::drawGearIndicator 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 340 in common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/overlay_text_display.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

OverlayTextDisplay::processMessage 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 280 in common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/overlay_text_display.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

OverlayTextDisplay::update 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 149 in common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/overlay_text_display.cpp

See this annotation in the file changed.

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

❌ New issue: Large Method

OverlayTextDisplay::OverlayTextDisplay has 77 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 167 in common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/overlay_utils.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

OverlayObject::updateTextureSize has 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 warning on line 428 in common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/signal_display.cpp

See this annotation in the file changed.

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

❌ New issue: Code Duplication

The module contains 7 functions with similar structure: SignalDisplay::topic_updated_gear,SignalDisplay::topic_updated_hazard_lights,SignalDisplay::topic_updated_speed,SignalDisplay::topic_updated_speed_limit and 3 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check notice on line 345 in planning/behavior_path_start_planner_module/src/manager.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

StartPlannerModuleManager::updateModuleParams is no longer above the threshold for lines of code. 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 187 in map/map_loader/src/lanelet2_map_loader/lanelet2_differential_loader_module.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

Lanelet2DifferentialLoaderModule::differentialLanelet2Load has a cyclomatic complexity of 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 warning on line 122 in map/map_loader/src/lanelet2_map_loader/lanelet2_differential_loader_module.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

Lanelet2DifferentialLoaderModule::loadWholeMap 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 122 in map/map_loader/src/lanelet2_map_loader/lanelet2_differential_loader_module.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

Lanelet2DifferentialLoaderModule::loadWholeMap 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 warning on line 187 in map/map_loader/src/lanelet2_map_loader/lanelet2_differential_loader_module.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

Lanelet2DifferentialLoaderModule::differentialLanelet2Load 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 warning on line 164 in map/autoware_dynamic_lanelet_provider/src/dynamic_lanelet_provider.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

DynamicLaneletProviderNode::updateMap has a cyclomatic complexity of 11, 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 164 in map/autoware_dynamic_lanelet_provider/src/dynamic_lanelet_provider.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

DynamicLaneletProviderNode::updateMap 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.