CodeScene PR Check
β Code Health Quality Gates: FAILED
- Declining Code Health: 4 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 test_longitudinal_controller_utils.cpp: TEST:TestLongitudinalControllerUtils:lerpTrajectoryPoint
- Large Method pid_longitudinal_controller.cpp: PidLongitudinalController::getControlData
- Complex Method pid_longitudinal_controller.cpp: PidLongitudinalController::predictedStateAfterDelay
β 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 1003 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 168 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 116 to 118 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 519 in control/pid_longitudinal_controller/src/pid_longitudinal_controller.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
β New issue: Large Method
PidLongitudinalController::getControlData has 70 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.
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.19 to 4.30, 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.