feat(accel_brake_map_calibrator): replace polling takeData function with the callback function #7282
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 2 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Bumpy Road Ahead accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::timerCallback
✅ Improving Code Health:
- Lines of Code in a Single File accel_brake_map_calibrator_node.cpp
- Complex Method accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::AccelBrakeMapCalibrator
Annotations
Check notice on line 1 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1362 to 1356, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Complex Method
AccelBrakeMapCalibrator::timerCallback increases in cyclomatic complexity from 23 to 28, 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)
✅ Getting better: Complex Method
AccelBrakeMapCalibrator::AccelBrakeMapCalibrator decreases in cyclomatic complexity from 19 to 17, 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: Bumpy Road Ahead
AccelBrakeMapCalibrator::timerCallback 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.
Check notice on line 1 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 4.06 to 4.17, 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 1 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 59.48% to 60.00%, 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.