CodeScene PR Check
β Code Health Quality Gates: FAILED
- Declining Code Health: 5 findings(s) π©
- Improving Code Health: 2 findings(s) β
- Affected Hotspots: 0 files(s) π₯
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
Details
π© Declining Code Health (highest to lowest):
- Large Method pid_longitudinal_controller.cpp: diagnostic_updater_
- Large Method pid_longitudinal_controller.cpp: PidLongitudinalController::paramCallback
- Large Method test_longitudinal_controller_utils.cpp: TEST:TestLongitudinalControllerUtils:lerpTrajectoryPoint
- Complex Method pid_longitudinal_controller.cpp: PidLongitudinalController::predictedStateAfterDelay
- Complex Method pid_longitudinal_controller.cpp: PidLongitudinalController::getControlData
β Improving Code Health:
- Complex Method pid_longitudinal_controller.cpp: PidLongitudinalController::predictedVelocityInTargetPoint
- Primitive Obsession longitudinal_controller_utils.cpp
Annotations
Check notice on line 1 in control/pid_longitudinal_controller/src/longitudinal_controller_utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 67.86% to 63.64%, 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 notice on line 1036 in control/pid_longitudinal_controller/src/pid_longitudinal_controller.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β No longer an issue: Complex Method
PidLongitudinalController::predictedVelocityInTargetPoint 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
PidLongitudinalController::predictedStateAfterDelay has a cyclomatic complexity of 10, 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 546 in control/pid_longitudinal_controller/src/pid_longitudinal_controller.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β New issue: Complex Method
PidLongitudinalController::getControlData has a cyclomatic complexity of 9, 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 191 in control/pid_longitudinal_controller/src/pid_longitudinal_controller.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β Getting worse: Large Method
diagnostic_updater_ increases from 120 to 133 lines of code, 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 377 in control/pid_longitudinal_controller/src/pid_longitudinal_controller.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β Getting worse: Large Method
PidLongitudinalController::paramCallback increases from 110 to 111 lines of code, 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 notice on line 1 in control/pid_longitudinal_controller/src/pid_longitudinal_controller.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
βΉ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 4.29 to 4.57, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β Getting worse: Large Method
TEST:TestLongitudinalControllerUtils:lerpTrajectoryPoint increases from 88 to 105 lines of code, 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 notice on line 63 in control/pid_longitudinal_controller/src/pid.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
βΉ New issue: Excess Number of Function Arguments
PIDController::calculate has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.