refactor(autoware_image_projection_based_fusion): organize 2d-detection related members #9789
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.03 (8.54 -> 8.51)
- Declining Code Health: 4 findings(s) 🚩
- Improving Code Health: 3 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Overall Code Complexity fusion_node.cpp
- Complex Method fusion_node.cpp: subCallback
- Complex Method fusion_node.cpp: setDet2DStatus
- Bumpy Road Ahead node.cpp: RoiDetectedObjectFusionNode::postprocess
✅ Improving Code Health:
- Deep, Nested Complexity fusion_node.cpp: subCallback
- Complex Conditional node.cpp: RoiDetectedObjectFusionNode::publish
- Complex Method node.cpp: RoiDetectedObjectFusionNode::publish
Annotations
Check warning on line 376 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
subCallback increases in cyclomatic complexity from 20 to 21, 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 210 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
setDet2DStatus 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 1 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 7.25 across 8 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 notice on line 376 in perception/autoware_image_projection_based_fusion/src/fusion_node.cpp
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. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
RoiDetectedObjectFusionNode::publish 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Complex Method
RoiDetectedObjectFusionNode::postprocess has a cyclomatic complexity of 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
RoiDetectedObjectFusionNode::publish no longer has a complex conditional. 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Complex Conditional
RoiDetectedObjectFusionNode::postprocess has 2 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
RoiDetectedObjectFusionNode::postprocess 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.