feat(accel_brake_map_calibrator): replace polling takeData function with the callback function #7266
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 22 findings(s) 🚩
Details
🚩 Declining Code Health (highest to lowest):
- Complex Conditional accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::timerCallback
- Complex Method accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::timerCallback
- Lines of Code in a Single File accel_brake_map_calibrator_node.cpp
- Overall Code Complexity accel_brake_map_calibrator_node.cpp
- Complex Method accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::AccelBrakeMapCalibrator
- Complex Method accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::updateFourCellAroundOffset
- Complex Method accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::updateAccelBrakeMap
- Primitive Obsession accel_brake_map_calibrator_node.cpp
- Bumpy Road Ahead accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::indexValueSearch
- Bumpy Road Ahead node.cpp: ExternalCmdConverterNode::checkRemoteTopicRate
- Bumpy Road Ahead accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::updateAccelBrakeMap
- Bumpy Road Ahead accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::updateTotalMapOffset
- Bumpy Road Ahead accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::publishMap
- Bumpy Road Ahead accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::writeMapToCSV
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::addLogToCSV
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::updateEachValOffset
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::updateFourCellAroundOffset
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::executeUpdate
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::calculateEstimatedAcc
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::calculateAccelSquaredError
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::calculateAccelErrorL1Norm
- Excess Number of Function Arguments accel_brake_map_calibrator_node.cpp: AccelBrakeMapCalibrator::getOccMsg
Annotations
Check warning on line 238 in vehicle/external_cmd_converter/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
ExternalCmdConverterNode::checkRemoteTopicRate 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: Lines of Code in a Single File
This module has 1349 lines of code, 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)
❌ New issue: Complex Method
AccelBrakeMapCalibrator::timerCallback has a cyclomatic complexity of 25, 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
AccelBrakeMapCalibrator::AccelBrakeMapCalibrator has a cyclomatic complexity of 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: Complex Method
AccelBrakeMapCalibrator::updateFourCellAroundOffset has a cyclomatic complexity of 16, 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
AccelBrakeMapCalibrator::updateAccelBrakeMap has a cyclomatic complexity of 16, 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 Conditional
AccelBrakeMapCalibrator::timerCallback has 2 complex conditionals with 8 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
AccelBrakeMapCalibrator::indexValueSearch 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
AccelBrakeMapCalibrator::updateAccelBrakeMap 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
AccelBrakeMapCalibrator::updateTotalMapOffset 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
AccelBrakeMapCalibrator::publishMap 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
AccelBrakeMapCalibrator::writeMapToCSV 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.11 across 53 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)
❌ New issue: Primitive Obsession
In this module, 60.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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
AccelBrakeMapCalibrator::executeUpdate has 5 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
AccelBrakeMapCalibrator::updateFourCellAroundOffset has 6 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
AccelBrakeMapCalibrator::updateEachValOffset has 7 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
AccelBrakeMapCalibrator::calculateEstimatedAcc has 5 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
AccelBrakeMapCalibrator::calculateAccelSquaredError has 5 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
AccelBrakeMapCalibrator::calculateAccelErrorL1Norm has 5 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
AccelBrakeMapCalibrator::getOccMsg has 5 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
AccelBrakeMapCalibrator::addLogToCSV has 15 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.