Skip to content

fix: non-maximum suppression target decision logic

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) succeeded Dec 11, 2024 in 33s

CodeScene PR Check

βœ… Code Health Quality Gates: OK

Change in average Code Health of affected files: +0.11 (9.29 -> 9.40)

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

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Conditional non_maximum_suppression.cpp: NonMaximumSuppression::isTargetPairObject

βœ… Improving Code Health:

  • Large Method test_nms.cpp: TEST:NonMaximumSuppressionTest:Apply
  • Large Method lidar_transfusion_node.cpp: LidarTransfusionNode::LidarTransfusionNode
  • Bumpy Road Ahead non_maximum_suppression.cpp: NonMaximumSuppression::generateIoUMatrix
  • Deep, Nested Complexity non_maximum_suppression.cpp: NonMaximumSuppression::generateIoUMatrix

Annotations

Check warning on line 45 in perception/autoware_lidar_transfusion/lib/postprocess/non_maximum_suppression.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

NonMaximumSuppression::isTargetPairObject 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 74 in perception/autoware_lidar_transfusion/lib/postprocess/non_maximum_suppression.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

NonMaximumSuppression::generateIoUMatrix is no longer above the threshold for logical blocks with deeply nested code

Check notice on line 74 in perception/autoware_lidar_transfusion/lib/postprocess/non_maximum_suppression.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

NonMaximumSuppression::generateIoUMatrix is no longer above the threshold for nested complexity depth

Check notice on line 67 in perception/autoware_lidar_transfusion/src/lidar_transfusion_node.cpp

See this annotation in the file changed.

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

βœ… Getting better: Large Method

LidarTransfusionNode::LidarTransfusionNode decreases from 81 to 78 lines of code, 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 notice on line 26 in perception/autoware_lidar_transfusion/test/test_nms.cpp

See this annotation in the file changed.

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

βœ… Getting better: Large Method

TEST:NonMaximumSuppressionTest:Apply decreases from 82 to 80 lines of code, 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.