Skip to content

fix: resolve cppcheck issue shadowVariable

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Dec 26, 2024 in 33s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

Change in average Code Health of affected files: +0.34 (8.53 -> 8.86)

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

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Overall Code Complexity node.cpp

βœ… Improving Code Health:

  • Complex Method fusion_node.cpp: subCallback
  • Complex Method fusion_node.cpp: roiCallback
  • Bumpy Road Ahead fusion_node.cpp: subCallback
  • Bumpy Road Ahead fusion_node.cpp: roiCallback
  • Deep, Nested Complexity fusion_node.cpp: subCallback
  • Deep, Nested Complexity fusion_node.cpp: roiCallback

Annotations

Check notice on line 364 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp

See this annotation in the file changed.

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

βœ… Getting better: Complex Method

subCallback decreases in cyclomatic complexity from 20 to 19, 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 428 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp

See this annotation in the file changed.

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

βœ… Getting better: Complex Method

roiCallback decreases in cyclomatic complexity from 10 to 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 notice on line 364 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp

See this annotation in the file changed.

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

βœ… Getting better: Bumpy Road Ahead

subCallback decreases from 5 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 notice on line 428 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp

See this annotation in the file changed.

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

βœ… No longer an issue: Bumpy Road Ahead

roiCallback is no longer above the threshold for logical blocks with deeply nested code. 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 364 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp

See this annotation in the file changed.

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

βœ… No longer an issue: Deep, Nested Complexity

subCallback is no longer above the threshold for nested complexity depth

Check notice on line 428 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp

See this annotation in the file changed.

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

βœ… No longer an issue: Deep, Nested Complexity

roiCallback is no longer above the threshold for nested complexity depth

Check warning on line 1 in perception/autoware_image_projection_based_fusion/src/roi_cluster_fusion/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 8.71 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.