feat(lane_change): improve delay lane change logic #9480
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.19 (6.28 -> 6.47)
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 9 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Complex Method manager.cpp: LaneChangeModuleManager::set_params
✅ Improving Code Health:
- Lines of Code in a Single File scene.cpp 🔥
- Overall Code Complexity utils.cpp 🔥
- Complex Conditional utils.cpp: passed_parked_objects 🔥
- Complex Method utils.cpp: getLeadingStaticObjectIdx 🔥
- Complex Method utils.cpp: passed_parked_objects 🔥
- Complex Method utils.cpp: isParkedObject 🔥
- Bumpy Road Ahead utils.cpp: isParkedObject 🔥
- Excess Number of Function Arguments utils.cpp: getLeadingStaticObjectIdx 🔥
- Lines of Code in a Single File utils.cpp 🔥
Annotations
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
getLeadingStaticObjectIdx 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
passed_parked_objects 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
isParkedObject 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
is_delay_lane_change has a cyclomatic complexity of 13, 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
passed_parked_objects 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)
ℹ New issue: Complex Conditional
is_delay_lane_change has 1 complex conditionals with 2 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
isParkedObject 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 5.09 to 4.88, 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
getLeadingStaticObjectIdx 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
LaneChangeModuleManager::set_params already has high cyclomatic complexity, and now it increases in Lines of Code from 193 to 196. 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)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1607 to 1606, 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.