refactor(lane_change): separate path-related function to utils/path #9633
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.71 (5.57 -> 6.28)
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 10 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Overall Code Complexity path.cpp
- Complex Method path.cpp: construct_candidate_path
- Excess Number of Function Arguments path.cpp: get_candidate_path
✅ Improving Code Health:
- Lines of Code in a Single File scene.cpp 🔥
- Overall Code Complexity scene.cpp 🔥
- Overall Code Complexity utils.cpp 🔥
- Complex Conditional scene.cpp: NormalLaneChange::calcTerminalLaneChangePath 🔥
- Complex Method utils.cpp: construct_candidate_path 🔥
- Complex Method scene.cpp: NormalLaneChange::is_collided 🔥
- Complex Method scene.cpp: NormalLaneChange::calcTerminalLaneChangePath 🔥
- Bumpy Road Ahead utils.cpp: construct_candidate_path 🔥
- Excess Number of Function Arguments utils.cpp: construct_candidate_path 🔥
- Lines of Code in a Single File utils.cpp 🔥
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1610 to 1356, 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)
ℹ Getting worse: Complex Method
NormalLaneChange::check_candidate_path_safety increases in cyclomatic complexity from 12 to 14, 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)
✅ No longer an issue: Complex Method
NormalLaneChange::is_collided 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)
✅ No longer an issue: Complex Method
NormalLaneChange::calcTerminalLaneChangePath 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
NormalLaneChange::is_colliding has a cyclomatic complexity of 14, 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)
✅ No longer an issue: Complex Conditional
NormalLaneChange::calcTerminalLaneChangePath no longer has a complex conditional. 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)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.80 to 4.71, 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)
❌ New issue: Complex Method
construct_candidate_path has a cyclomatic complexity of 12, 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: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.63 across 8 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: Excess Number of Function Arguments
get_candidate_path 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)
✅ No longer an issue: Lines of Code in a Single File
The lines of code in this module is no longer above the threshold
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
construct_candidate_path 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)
✅ No longer an issue: Bumpy Road Ahead
construct_candidate_path is no longer above the threshold for logical blocks with deeply nested code. 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)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.89 to 4.80, 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)
✅ No longer an issue: Excess Number of Function Arguments
construct_candidate_path is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.