python:S5724 Remove 1 parameters; property deleter methods receive only "self"

  • What language is this for? python

  • Which rule? python:S5724

  • Why do you believe it’s a false-positive/false-negative? method is not marked as property: def delete_location(self, index_to_delete)

  • Version:

    • SonarQube Community Build
      v25.3.0.104237 (updated!) (was: SonarQube Server Community Editionv9.9.8 (build 100196))
    • SonarScanner CLI 7.1.0.4889 (was: SonarScanner 5.0.1)
  • How can we reproduce the problem?

      class A:
    
          def delete_whatever(self, arg):
              pass
    

Hi,

Welcome to the community!

Only the latest version of SonarQube Community Build is considered active, so you’ll need to upgrade and see if the situation is still replicable before we can help you.

Your upgrade path is:

9.9.8 → 24.12 → 25.3

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your FP persists after upgrade, please come back to us.

1 Like

Upgraded sonarqube community to the last version, but error remains. Thanks.

Hello @erny,

Thanks for the reporting and sorry for the late reply.
Based on the example your provided we cannot reproduce the issue, could you provide an example with more details?

Also maybe it could help: there are two ways to mark a method as a property method where an issue for the rule could be raised:

  • with decorators
    class A:
        @property
        def whatever(self): ...
    
        @whatever.deleter
        def delete_whatever(self, arg): ...
    
  • with the property call
    class A:
        ...
        def delete_whatever(self, arg): ...
    
        whatever = property(get_whatever, set_whatever, delete_whatever)
    

Thanks,
Maksim Grebeniuk

1 Like