Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoware_image_based_projection_fusion): redesign image based projection fusion node #10016

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

chore: clean code

a5d99b2
Select commit
Loading
Failed to load commit list.
Draft

feat(autoware_image_based_projection_fusion): redesign image based projection fusion node #10016

chore: clean code
a5d99b2
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Feb 13, 2025 in 34s

CodeScene PR Check

Quality Gate Failed

Gates Failed
New code is healthy (1 new file with code health below 9.00)
Enforce critical code health rules (1 file with Bumpy Road Ahead, Deep, Nested Complexity)
Enforce advisory code health rules (3 files with Code Duplication, Complex Method, Overall Code Complexity, Complex Conditional)

Gates Passed
1 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
New code is healthy Violations Code Health Impact
fusion_matching_strategy.cpp 5 rules 10.00 → 7.59 Suppress
Enforce critical code health rules Violations Code Health Impact
fusion_matching_strategy.cpp 2 critical rules 10.00 → 7.59 Suppress
Enforce advisory code health rules Violations Code Health Impact
fusion_matching_strategy.cpp 3 advisory rules 10.00 → 7.59 Suppress
fusion_node.cpp 2 advisory rules 7.28 → 6.86 Suppress
concatenate_and_time_sync_node.cpp 1 advisory rule 7.15 → 7.13 Suppress

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Details

🚩 Declining Code Health (highest to lowest):

  • Code Duplication fusion_matching_strategy.cpp
  • Overall Code Complexity fusion_matching_strategy.cpp
  • Code Duplication fusion_node.cpp
  • Complex Method concatenate_and_time_sync_node.cpp: PointCloudConcatenateDataSynchronizerComponent::PointCloudConcatenateDataSynchronizerComponent
  • Complex Method fusion_matching_strategy.cpp: get_concatenated_offset
  • Deep, Nested Complexity fusion_matching_strategy.cpp: get_concatenated_offset
  • Complex Conditional fusion_node.cpp: check_fusion_status
  • Deep, Nested Complexity fusion_matching_strategy.cpp: match_rois_to_collector
  • Deep, Nested Complexity fusion_matching_strategy.cpp: match_msg3d_to_collector
  • Bumpy Road Ahead fusion_matching_strategy.cpp: get_concatenated_offset

✅ Improving Code Health:

  • Overall Code Complexity fusion_node.cpp
  • Complex Method node.cpp: RoiClusterFusionNode::fuseOnSingleImage
  • Bumpy Road Ahead node.cpp: RoiClusterFusionNode::fuseOnSingleImage
  • Deep, Nested Complexity node.cpp: RoiClusterFusionNode::fuseOnSingleImage
  • Deep, Nested Complexity fusion_node.cpp: roiCallback
  • Complex Method fusion_node.cpp: subCallback
  • Complex Method fusion_node.cpp: roiCallback
  • Complex Method fusion_node.cpp: setDet2DStatus
  • Bumpy Road Ahead fusion_node.cpp: subCallback
  • Bumpy Road Ahead fusion_node.cpp: roiCallback

Annotations

Check warning on line 83 in perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.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 2 functions with similar structure: match_msg3d_to_collector,match_rois_to_collector. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 336 in perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

get_concatenated_offset has a cyclomatic complexity of 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 336 in perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

get_concatenated_offset has 4 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 perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.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 6.30 across 10 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 336 in perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

get_concatenated_offset has a nested complexity depth of 5, 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 83 in perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

match_rois_to_collector 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 110 in perception/autoware_image_projection_based_fusion/src/fusion_matching_strategy.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

match_msg3d_to_collector 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 427 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)

❌ New issue: Code Duplication

The module contains 2 functions with similar structure: rois_callback,sub_callback. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check notice on line 427 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: Complex Method

subCallback is no longer above the threshold for cyclomatic complexity. 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 534 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: Complex Method

roiCallback is no longer above the threshold for cyclomatic complexity. 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 255 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: Complex Method

setDet2DStatus is no longer above the threshold for cyclomatic complexity. 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 666 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)

❌ New issue: Complex Conditional

check_fusion_status 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 notice on line 427 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

subCallback 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 534 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 1 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: Overall Code Complexity

The mean cyclomatic complexity decreases from 7.00 to 5.71, 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 534 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. 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 214 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)

✅ No longer an issue: Complex Method

RoiClusterFusionNode::fuseOnSingleImage is no longer above the threshold for cyclomatic complexity. 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 214 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)

✅ No longer an issue: Bumpy Road Ahead

RoiClusterFusionNode::fuseOnSingleImage 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 214 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)

✅ No longer an issue: Deep, Nested Complexity

RoiClusterFusionNode::fuseOnSingleImage is no longer above the threshold for nested complexity depth. 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 156 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

PointCloudConcatenateDataSynchronizerComponent::PointCloudConcatenateDataSynchronizerComponent already has high cyclomatic complexity, and now it increases in Lines of Code from 96 to 102. 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.