Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule EC7 detects object (__init__) with one argument as a setter #17

Closed
AghilesAzzoug opened this issue Jan 16, 2024 · 1 comment · Fixed by #20
Closed

Rule EC7 detects object (__init__) with one argument as a setter #17

AghilesAzzoug opened this issue Jan 16, 2024 · 1 comment · Fixed by #20
Assignees
Labels
💉 bug Something isn't working

Comments

@AghilesAzzoug
Copy link

Rule EC7 (AvoidGettersAndSetters) detects __init__ methods with one argument and assignment as a setter.

To Reproduce
Code that can reproduce the error:

class Something:
    def __init__(self, value):
        self.value = value
...

Expected behavior
It shouldn't be detected as a code smell since init method is used to assign values to object properties.

Software Versions

  • SonarQube Version: 9.9
  • Plugin Version: 1.4.0
@dedece35 dedece35 self-assigned this Feb 1, 2024
@dedece35 dedece35 added the 💉 bug Something isn't working label Feb 1, 2024
@dedece35 dedece35 linked a pull request Feb 1, 2024 that will close this issue
@dedece35
Copy link
Member

dedece35 commented Feb 1, 2024

Hi @AghilesAzzoug ,

thank you for your issue. you agree it's a bug.
the correction is done in related PR.
I'm waiting for core team reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💉 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants