Critical False Positive when returning > and >= in python

When returning > and >=, sonarlint return a critical error: Refactor this method to not always return the same value. [+2 locations]sonarlint(python:S3516)

def test_sq(yay):
    b = 1
    c = 1
    if yay:
        return b > c
        return b >= c

I am also getting a 403 status while trying to edit my original message

This is the same logic while doing < and <= as well.

Hello @momoney,

Thank you for reporting this false positive. I have created this ticket to track it.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.