question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OverusedExpressionViolation and TooManyExpressionsViolation

See original GitHub issue

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?

max-expressions=9 # TooManyExpressionsViolation for module, function or method
max-module-expressions=7 # OverusedExpressionViolation for module
max-function-expressions=4 # OverusedExpressionViolation for function or method

How is that should be

Looks like TooManyExpressionsViolation doesn’t need at all.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
sobolevncommented, Dec 18, 2019

Your functions will grow too big. And you will fail to understand them. Smaller functions = better composition and better readability. See: https://sobolevn.me/2019/10/complexity-waterfall

Expressions overuse on the other hand indicates, that you are repeating some important thing without proper abstraction. That’s how my_list[0][1] becomes username = and obj.find('<button>', 1) becomes obj.find_button()

0reactions
sobolevncommented, Jun 9, 2020

The “right” way would be supported in #1120

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Elements of Style - Douglas Crockford
But a writer should be careful not to construct too many of his sentences after this pattern (see ... Many expressions in common...
Read more >
Freedom of Expression - American Civil Liberties Union
It took nearly 200 years to establish firm constitutional limits on the government's power to punish "seditious" and "subversive" speech. Many people ...
Read more >
A CHEAT SHEET OF COMMON VIOLATIONS OF ENGLISH ...
A Cheat Sheet of Common Violations of English Words and English Expressions. Here are the most common wrong uses and preferred uses of...
Read more >
The value of cliches in spoken word - The Campus
Both in writing and in speech, the use of cliches is often discouraged. ... These expressions are all certainly overused and perhaps ...
Read more >
Worn-Out Words and Phrases: 2017
Many serve a fleeting purpose before they lose their. ... and interpersonal—which, when you think about it, is really where most violations occur....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found