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

fix(pointcloud_preprocessor): fix distortion corrector unit test #7833

Merged

Merge branch 'main' into fix/distortion_correction_node_unit_test

419dea1
Select commit
Loading
Failed to load commit list.
Merged

fix(pointcloud_preprocessor): fix distortion corrector unit test #7833

Merge branch 'main' into fix/distortion_correction_node_unit_test
419dea1
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Jul 9, 2024 in 50s

CodeScene PR Check

Code Health Quality Gates: FAILED

Change in average Code Health of affected files: -0.41 (8.37 -> 7.96)

  • Declining Code Health: 5 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Code Duplication test_distortion_corrector_node.cpp
  • Duplicated Assertion Blocks test_distortion_corrector_node.cpp
  • Large Method test_distortion_corrector_node.cpp: TEST:DistortionCorrectorTest:TestUndistortPointCloudWithPureRotationalMotion
  • Primitive Obsession test_distortion_corrector_node.cpp
  • Excess Number of Function Arguments test_distortion_corrector_node.cpp: generateTransformMsg

✅ Improving Code Health:

  • Overall Code Complexity distortion_corrector.cpp

Annotations

Check warning on line 379 in sensing/pointcloud_preprocessor/test/test_distortion_corrector_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 9 functions with similar structure: TEST:DistortionCorrectorTest:TestUndistortPointCloud2dWithImuInBaseLink,TEST:DistortionCorrectorTest:TestUndistortPointCloud2dWithImuInLidarFrame,TEST:DistortionCorrectorTest:TestUndistortPointCloud2dWithoutImuInBaseLink,TEST:DistortionCorrectorTest:TestUndistortPointCloud3dWithImuInBaseLink and 5 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 895 in sensing/pointcloud_preprocessor/test/test_distortion_corrector_node.cpp

See this annotation in the file changed.

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

❌ New issue: Large Method

TEST:DistortionCorrectorTest:TestUndistortPointCloudWithPureRotationalMotion 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 1 in sensing/pointcloud_preprocessor/test/test_distortion_corrector_node.cpp

See this annotation in the file changed.

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

❌ New issue: Primitive Obsession

In this module, 70.0% of all function arguments are primitive types, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.

Check warning on line 103 in sensing/pointcloud_preprocessor/test/test_distortion_corrector_node.cpp

See this annotation in the file changed.

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

❌ New issue: Excess Number of Function Arguments

generateTransformMsg has 9 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1 in sensing/pointcloud_preprocessor/test/test_distortion_corrector_node.cpp

See this annotation in the file changed.

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

❌ New issue: Duplicated Assertion Blocks

The test suite contains 7 functions with duplicated assertion blocks (TEST:DistortionCorrectorTest:TestUndistortPointCloud2dWithImuInBaseLink,TEST:DistortionCorrectorTest:TestUndistortPointCloud2dWithImuInLidarFrame,TEST:DistortionCorrectorTest:TestUndistortPointCloud2dWithoutImuInBaseLink,TEST:DistortionCorrectorTest:TestUndistortPointCloud3dWithImuInBaseLink and 3 more functions), threshold = 2. This test file has several blocks of duplicated assertion statements. Avoid adding more.

Check notice on line 1 in sensing/pointcloud_preprocessor/src/distortion_corrector/distortion_corrector.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Overall Code Complexity

The mean cyclomatic complexity in this module is no longer above the threshold