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

feat(accel_brake_map_calibrator): replace polling takeData function with the callback function #7266

style(pre-commit): autofix

a9a690c
Select commit
Loading
Failed to load commit list.
Closed

feat(accel_brake_map_calibrator): replace polling takeData function with the callback function #7266

style(pre-commit): autofix
a9a690c
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Jun 11, 2024 in 45s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 22 findings(s) 🚩

View detailed results in CodeScene

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

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 415 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 221 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 988 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 809 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 309 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 645 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 809 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1068 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1406 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1655 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis 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.

Check warning on line 1 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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, 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.

Check warning on line 840 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::executeUpdate has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 988 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::updateFourCellAroundOffset has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1037 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::updateEachValOffset has 7 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1164 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::calculateEstimatedAcc has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1174 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::calculateAccelSquaredError has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1184 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::calculateAccelErrorL1Norm has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1303 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::getOccMsg has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 1679 in vehicle/accel_brake_map_calibrator/src/accel_brake_map_calibrator_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

AccelBrakeMapCalibrator::addLogToCSV has 15 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.