feat(lane_change): revise current lane objects filtering #9785
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)
failed
Dec 27, 2024 in 48s
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.10 (6.18 -> 6.28)
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 6 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Complex Method manager.cpp: LaneChangeModuleManager::set_params
- Large Method manager.cpp: LaneChangeModuleManager::updateModuleParams
- Complex Method scene.cpp: NormalLaneChange::insert_stop_point_on_current_lanes 🔥
✅ Improving Code Health:
- Lines of Code in a Single File scene.cpp 🔥
- Overall Code Complexity utils.cpp 🔥
- Complex Conditional scene.cpp: NormalLaneChange::filter_objects 🔥
- Complex Method utils.cpp: get_min_dist_to_current_lanes_obj 🔥
- Complex Method scene.cpp: NormalLaneChange::filter_objects 🔥
- Bumpy Road Ahead utils.cpp: get_min_dist_to_current_lanes_obj 🔥
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1358 to 1357, 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 better: Complex Method
NormalLaneChange::filter_objects decreases in cyclomatic complexity from 12 to 11, 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)
❌ Getting worse: Complex Method
NormalLaneChange::insert_stop_point_on_current_lanes increases in cyclomatic complexity from 9 to 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Conditional
NormalLaneChange::filter_objects decreases from 1 complex conditionals with 3 branches to 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: Complex Method
get_min_dist_to_current_lanes_obj 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
get_min_dist_to_current_lanes_obj 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.80 to 4.78, 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: Complex Method
LaneChangeModuleManager::set_params already has high cyclomatic complexity, and now it increases in Lines of Code from 200 to 202. 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 worse: Large Method
LaneChangeModuleManager::updateModuleParams increases from 104 to 106 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.
Loading