You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As highlighted in discussion of Issue #3501, the NullSafe Operator (?->) is not taken into consideration when calculating complexity in the Generic.Metrics.CyclomaticComplexity sniff.
This operator should increment the Cyclomatic Complexity score by 1, because there are two paths through the code each cases.
gsherwood
changed the title
The nullsafe operator (?->) is not counted in Generic.Metrics.CyclomaticComplexity
The nullsafe operator is not counted in Generic.Metrics.CyclomaticComplexity
Jan 17, 2022
As highlighted in discussion of Issue #3501, the NullSafe Operator (
?->
) is not taken into consideration when calculating complexity in the Generic.Metrics.CyclomaticComplexity sniff.This operator should increment the Cyclomatic Complexity score by 1, because there are two paths through the code each cases.
can be re-written as an if/else statement
with two branches through the code, which should increment the CYC count by one.
The text was updated successfully, but these errors were encountered: