feat(traffic_light_arbiter): add signal match validator #6423
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 5 findings(s) 🚩
- Improving Code Health: 0 findings(s) ✅
- Affected Hotspots: 0 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):
- Overall Code Complexity traffic_light_arbiter.cpp
- Complex Method signal_match_validator.cpp: SignalMatchValidator::validateSignals
- Complex Method traffic_light_arbiter.cpp: TrafficLightArbiter::arbitrateAndPublish
- Complex Conditional signal_match_validator.cpp: get_newer_stamp
- Bumpy Road Ahead traffic_light_arbiter.cpp: TrafficLightArbiter::arbitrateAndPublish
Annotations
Check warning on line 268 in perception/traffic_light_arbiter/src/signal_match_validator.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
SignalMatchValidator::validateSignals has a cyclomatic complexity of 15, 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 200 in perception/traffic_light_arbiter/src/signal_match_validator.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
get_newer_stamp 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 warning on line 188 in perception/traffic_light_arbiter/src/traffic_light_arbiter.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
TrafficLightArbiter::arbitrateAndPublish increases in cyclomatic complexity from 13 to 15, 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 188 in perception/traffic_light_arbiter/src/traffic_light_arbiter.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
TrafficLightArbiter::arbitrateAndPublish has 3 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 warning on line 1 in perception/traffic_light_arbiter/src/traffic_light_arbiter.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.14 across 7 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.