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

check the ratio (comments + docstrings) / lines of code #693

Closed
pylint-bot opened this issue Nov 4, 2015 · 1 comment
Closed

check the ratio (comments + docstrings) / lines of code #693

pylint-bot opened this issue Nov 4, 2015 · 1 comment

Comments

@pylint-bot
Copy link

Originally reported by: Laura Médioni (BitBucket: lmedioni, GitHub: @lmedioni?)


A refactor message could be triggered when the ratio (comments + docstrings) / lines of code would be under a given limit.

  • The ratio would be computed by function and by module
  • It would be possible to configure 2 limits (one for the functions, one for the modules)
  • It would be possible to configure a minimum number of lines under which the rule wouldn't apply on functions

@PCManticore
Copy link
Contributor

I don't think this checker is useful. The ratio is opinionated and there is no evidence that respecting the check will lead to code that's easier to understand or to maintain. It starts from the assumption that code with less docstrings or comments isn't as maintainable than code with them, which is from where the opinionated part comes from. Without having statistic evidence and a proper path to follow for the user in case it violates the rule, then it will bring more pain than solving any real problem. Following #746 I'm reticent to include checkers such as this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants