fix(avoidance): the module ignored merging objects unexpectedly #6601
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 6 findings(s) ✅
- Affected Hotspots: 2 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):
- Complex Method utils.cpp: isParkedVehicle 🔥
- Complex Method utils.cpp: isSatisfiedWithVehicleCondition 🔥
- Complex Method utils.cpp: isAmbiguousStoppedVehicle 🔥
✅ Improving Code Health:
- Complex Method shift_line_generator.cpp: ShiftLineGenerator::generateAvoidOutline
- Lines of Code in a Single File scene.cpp 🔥
- Overall Code Complexity scene.cpp 🔥
- Overall Code Complexity shift_line_generator.cpp
- Overall Code Complexity utils.cpp 🔥
- Complex Method utils.cpp: isForceAvoidanceTarget 🔥
Annotations
Check notice on line 1 in planning/behavior_path_avoidance_module/src/debug.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 45.24% to 45.45%, 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 1 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1895 to 1901, 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.
Check notice on line 1 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Number of Functions in a Single Module
The number of functions increases from 79 to 80, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check warning on line 539 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
isParkedVehicle increases in cyclomatic complexity from 10 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.
Check warning on line 803 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
isSatisfiedWithVehicleCondition 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.
Check notice on line 666 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
isForceAvoidanceTarget 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.
Check warning on line 666 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
isAmbiguousStoppedVehicle 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 notice on line 1 in planning/behavior_path_avoidance_module/src/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.96 to 4.94, 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 1 in planning/behavior_path_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1192 to 1185, 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.
Check notice on line 1 in planning/behavior_path_avoidance_module/src/scene.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.98 to 4.93, 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 331 in planning/behavior_path_avoidance_module/src/shift_line_generator.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Method
ShiftLineGenerator::generateAvoidOutline decreases in cyclomatic complexity from 50 to 48, 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 notice on line 1 in planning/behavior_path_avoidance_module/src/shift_line_generator.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 8.32 to 8.24, 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.