-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
OverusedExpressionViolation and TooManyExpressionsViolation #1077
Comments
Oh, I see. I guess we have to update the docs for this one. def test():
print(1)
print(2)
call_other(var)
# ... These are 3 expressions. We don't care about their semantics in this violation. But, def test1():
print(my[key])
def test2():
if my[key] > 1:
call(my[key]) In this snippet we have Does it make it sense to you? |
It does make sense. How about specifying that overuse of |
Yeap 👍 And I guess we can also link them together (with |
I got these violations but I didn't get why do we need them... |
Your functions will grow too big. And you will fail to understand them. Expressions overuse on the other hand indicates, that you are repeating some important thing without proper abstraction. That's how |
@AlwxSin do you want to fix the docs for this one? |
Hi!
I faced with WPS204, and yes, there are a lot of repeated
... and call it in each test. |
@ko3luhbka just turn off this rule in tests. |
Oh, okay, it was a kind of "last resort" for me. I just thought that it's possible to fix it "right" somehow. |
The "right" way would be supported in #1120 |
Bug report
What's wrong
What's the difference between these violations? And how they work together?
Also, it's hard to understand options, how should I combine them?
How is that should be
Looks like
TooManyExpressionsViolation
doesn't need at all.The text was updated successfully, but these errors were encountered: