refactor(crosswalk): clean up the structure and create a brief flowchart #7868
CodeScene PR Check
✅ Code Health Quality Gates: OK
Change in average Code Health of affected files: +0.38 (5.58 -> 5.96)
- Improving Code Health: 10 findings(s) ✅
- Affected Hotspots: 1 files(s) 🔥
Details
✅ Improving Code Health:
- Overall Code Complexity scene_crosswalk.cpp 🔥
- Complex Method scene_crosswalk.cpp: CrosswalkModule::checkStopForCrosswalkUsers 🔥
- Complex Method scene_crosswalk.cpp: CrosswalkModule::checkStopForStuckVehicles 🔥
- Complex Method scene_walkway.cpp: WalkwayModule::modifyPathVelocity
- Complex Method scene_crosswalk.cpp: CrosswalkModule::modifyPathVelocity 🔥
- Complex Method scene_crosswalk.cpp: CrosswalkModule::applySafetySlowDownSpeed 🔥
- Deep, Nested Complexity scene_crosswalk.cpp: CrosswalkModule::modifyPathVelocity 🔥
- Bumpy Road Ahead scene_crosswalk.cpp: CrosswalkModule::checkStopForCrosswalkUsers 🔥
- Complex Conditional scene_crosswalk.cpp: CrosswalkModule::modifyPathVelocity 🔥
- Bumpy Road Ahead scene_crosswalk.cpp: CrosswalkModule::applySafetySlowDownSpeed 🔥
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Method
CrosswalkModule::checkStopForCrosswalkUsers decreases in cyclomatic complexity from 21 to 20, 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 Method
CrosswalkModule::checkStopForStuckVehicles decreases in cyclomatic complexity from 19 to 18, 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
CrosswalkModule::modifyPathVelocity 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
CrosswalkModule::applySafetySlowDownSpeed 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
CrosswalkModule::applySlowDownByOcclusion 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)
✅ No longer an issue: Complex Conditional
CrosswalkModule::modifyPathVelocity 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: Bumpy Road Ahead
CrosswalkModule::checkStopForCrosswalkUsers decreases from 5 to 4 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
CrosswalkModule::applySafetySlowDownSpeed 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)
ℹ New issue: Bumpy Road Ahead
CrosswalkModule::applySlowDown 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 6.39 to 5.91, 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: Deep, Nested Complexity
CrosswalkModule::modifyPathVelocity 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Deep, Nested Complexity
CrosswalkModule::applySlowDownByOcclusion has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Excess Number of Function Arguments
CrosswalkModule::checkStopForStuckVehicles has 5 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)
✅ Getting better: Complex Method
WalkwayModule::modifyPathVelocity 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.