feat(trajectory_follower): publsih control horzion #8977
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.09 (7.07 -> 6.98)
- Declining Code Health: 4 findings(s) 🚩
Details
🚩 Declining Code Health (highest to lowest):
- Large Assertion Blocks test_mpc.cpp
- Complex Method controller_node.cpp: Controller::mergeLatLonHorizon
- Complex Method controller_node.cpp: Controller::Controller
- Bumpy Road Ahead controller_node.cpp: Controller::mergeLatLonHorizon
Annotations
Check notice on line 1 in control/autoware_mpc_lateral_controller/src/mpc.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 5.11 to 5.16, 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 140 in control/autoware_mpc_lateral_controller/src/mpc.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
MPC::calculateMPC increases from 5 to 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 222 in control/autoware_mpc_lateral_controller/test/test_mpc.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Assertion Blocks
The test suite contains 8 assertion blocks with at least 4 assertions, threshold = 4. This test file has several blocks of large, consecutive assert statements. Avoid adding more.
Check warning on line 365 in control/autoware_trajectory_follower_node/src/controller_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
Controller::mergeLatLonHorizon 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 108 in control/autoware_trajectory_follower_node/src/controller_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
Controller::Controller 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 365 in control/autoware_trajectory_follower_node/src/controller_node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
Controller::mergeLatLonHorizon 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.