feat(autoware_pointcloud_preprocessor): distortion corrector node update azimuth and distance #8380
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.94 (8.23 -> 7.29)
- Declining Code Health: 11 findings(s) 🚩
- Improving Code Health: 9 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Code Duplication test_distortion_corrector_node.cpp
- Overall Code Complexity distortion_corrector.cpp
- Complex Method distortion_corrector.cpp: undistort_pointcloud
- Large Method test_distortion_corrector_node.cpp: TEST:DistortionCorrectorTest:TestUndistortPointcloudWithPureRotationalMotion
- Complex Method distortion_corrector.cpp: DistortionCorrectorBase::try_compute_angle_conversion
- Large Method test_distortion_corrector_node.cpp: TEST:DistortionCorrectorTest:TestUndistortPointcloudWithPureLinearMotion
- Complex Method test_distortion_corrector_node.cpp: generate_default_pointcloud
- Bumpy Road Ahead distortion_corrector.cpp: undistort_pointcloud
- Bumpy Road Ahead test_distortion_corrector_node.cpp: generate_default_pointcloud
- Bumpy Road Ahead distortion_corrector.cpp: DistortionCorrectorBase::process_twist_message
- Bumpy Road Ahead distortion_corrector.cpp: DistortionCorrectorBase::enqueue_imu
✅ Improving Code Health:
- Code Duplication test_distortion_corrector_node.cpp
- Complex Method distortion_corrector.cpp: undistortPointCloud
- Primitive Obsession distortion_corrector.cpp
- Primitive Obsession test_distortion_corrector_node.cpp
- Large Method test_distortion_corrector_node.cpp: TEST:DistortionCorrectorTest:TestUndistortPointCloudWithPureRotationalMotion
- Excess Number of Function Arguments test_distortion_corrector_node.cpp: generateTransformMsg
- Bumpy Road Ahead distortion_corrector.cpp: undistortPointCloud
- Excess Number of Function Arguments distortion_corrector.cpp: DistortionCorrector2D::undistortPointImplementation
- Excess Number of Function Arguments distortion_corrector.cpp: DistortionCorrector3D::undistortPointImplementation
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
undistortPointCloud 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
undistort_pointcloud has a cyclomatic complexity of 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
DistortionCorrectorBase::try_compute_angle_conversion 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
undistortPointCloud 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
undistort_pointcloud has 3 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
DistortionCorrectorBase::process_twist_message 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
DistortionCorrectorBase::enqueue_imu 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.15 across 20 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 48.65% to 47.37%, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Excess Number of Function Arguments
DistortionCorrector2D::undistortPointImplementation is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Excess Number of Function Arguments
DistortionCorrector3D::undistortPointImplementation is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Excess Number of Function Arguments
DistortionCorrector2D::undistort_point_implementation has 8 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Excess Number of Function Arguments
DistortionCorrector3D::undistort_point_implementation has 8 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Code Duplication
introduced similar code in: TEST:DistortionCorrectorTest:TestTryComputeAngleConversionCartesianPointcloud,TEST:DistortionCorrectorTest:TestTryComputeAngleConversionOnHesaiPointcloud,TEST:DistortionCorrectorTest:TestTryComputeAngleConversionOnRandomPointcloud,TEST:DistortionCorrectorTest:TestTryComputeAngleConversionOnVelodynePointcloud and 11 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Code Duplication
reduced similar code in: 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
generate_default_pointcloud has a cyclomatic complexity of 11, 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: Large Method
TEST:DistortionCorrectorTest:TestUndistortPointCloudWithPureRotationalMotion is no longer above the threshold for lines of code. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
TEST:DistortionCorrectorTest:TestUndistortPointcloudWithPureRotationalMotion has 81 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
TEST:DistortionCorrectorTest:TestUndistortPointcloudWithPureLinearMotion has 73 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
generate_default_pointcloud 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 70.00% to 54.05%, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Excess Number of Function Arguments
generateTransformMsg is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Excess Number of Function Arguments
generate_transform_msg has 9 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.