Skip to content

Fix S2583 FP: Any called two times #9780

@PavlinII

Description

@PavlinII

Description

S2583 is raising when a collection is checked for Any with two distinct conditions

Reproducer

        Private Sub Solve(Ns() As Node)
            If Ns.Any(Function(X) X.DAC AndAlso X.FFT) Then
                'Do something
            ElseIf Ns.Any(Function(X) X.DAC OrElse X.FFT) Then  'Noncompliant FP, condition is not the same
                'Do something
            Else
                'AoC
            End If
        End Sub

        Private Class Node

            Public DAC, FFT As Boolean

        End Class

Product and Version

SQ for VS 9.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions