CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 5 findings(s) 🚩
- Improving Code Health: 7 findings(s) ✅
- Affected Hotspots: 3 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 manager.cpp: AvoidanceModuleManager::AvoidanceModuleManager
- Large Method avoidance_module.cpp: AvoidanceModule::updateDebugMarker 🔥
- Large Method manager.cpp: AvoidanceByLaneChangeModuleManager::AvoidanceByLaneChangeModuleManager
- Complex Method utils.cpp: isObjectOnRoadShoulder 🔥
- Bumpy Road Ahead utils.cpp: isObjectOnRoadShoulder 🔥
✅ Improving Code Health:
- Complex Method utils.cpp: filterTargetObjects 🔥
- Overall Code Complexity utils.cpp 🔥
- Overall Code Complexity utils.cpp 🔥
- Bumpy Road Ahead utils.cpp: filterTargetObjects 🔥
- Deep, Nested Complexity utils.cpp: filterTargetObjects 🔥
- Complex Conditional utils.cpp: filterTargetObjects 🔥
- Brain Method utils.cpp: filterTargetObjects 🔥
Annotations
Check warning on line 136 in planning/behavior_path_planner/src/scene_module/avoidance/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
AvoidanceModuleManager::AvoidanceModuleManager already has high cyclomatic complexity, and now it increases in Lines of Code from 245 to 250. 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 346 in planning/behavior_path_planner/src/scene_module/lane_change/manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
AvoidanceByLaneChangeModuleManager::AvoidanceByLaneChangeModuleManager increases from 104 to 107 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.
Check notice on line 1 in planning/behavior_path_planner/src/utils/avoidance/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 1380 to 1438, 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 1369 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Method
filterTargetObjects decreases in cyclomatic complexity from 62 to 49, 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 434 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
isObjectOnRoadShoulder 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.
Check notice on line 1353 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
filterTargetObjects 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.
Check notice on line 334 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Complex Conditional
isObjectOnRoadShoulder 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.
Check notice on line 1369 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Bumpy Road Ahead
filterTargetObjects decreases from 9 to 6 logical blocks with deeply nested code, threshold is one single 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.
Check warning on line 434 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
isObjectOnRoadShoulder 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.
Check notice on line 1 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.43 to 5.25, 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 1369 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Deep, Nested Complexity
filterTargetObjects is no longer above the threshold for nested complexity depth. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Check notice on line 1369 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Brain Method
filterTargetObjects is no longer a brain method
Check notice on line 1 in planning/behavior_path_planner/src/utils/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 2801 to 2810, 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_planner/src/utils/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 92 to 93, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check notice on line 1 in planning/behavior_path_planner/src/utils/utils.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 6.29 to 6.26, 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: Lines of Code in a Single File
The lines of code increases from 2175 to 2176, 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: Large Method
AvoidanceModule::updateDebugMarker increases from 107 to 108 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.