fix(autoware_crosswalk_traffic_light_estimator): add process that guard access to empty elements #10281
CodeScene PR Check
Quality Gate Failed
Gates Failed
Enforce critical code health rules
(1 file with Deep, Nested Complexity)
Enforce advisory code health rules
(1 file with Complex Conditional)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
Enforce critical code health rules | Violations | Code Health Impact | |
---|---|---|---|
node.cpp | 1 critical rule | 6.76 → 6.28 | Suppress |
Enforce advisory code health rules | Violations | Code Health Impact | |
---|---|---|---|
node.cpp | 1 advisory rule | 6.76 → 6.28 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
Details
🚩 Declining Code Health (highest to lowest):
- Deep, Nested Complexity node.cpp: CrosswalkTrafficLightEstimatorNode::setCrosswalkTrafficSignal
- Complex Conditional node.cpp: CrosswalkTrafficLightEstimatorNode::updateFlashingState
Annotations
Check warning on line 358 in perception/autoware_crosswalk_traffic_light_estimator/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Conditional
CrosswalkTrafficLightEstimatorNode::updateFlashingState increases from 1 complex conditionals with 2 branches to 1 complex conditionals with 3 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 warning on line 310 in perception/autoware_crosswalk_traffic_light_estimator/src/node.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
CrosswalkTrafficLightEstimatorNode::setCrosswalkTrafficSignal 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.