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

False negative TooManyFunctions if both ignorePrivate & ignoreDeprecated is set to true #1439

Closed
IvanAntsiferov opened this issue Jan 24, 2019 · 5 comments
Assignees

Comments

@IvanAntsiferov
Copy link
Contributor

Expected Behavior

TooManyFunctions should ignore private functions, if that option is set to true in config.

Observed Behavior

TooManyFunctions has false negative report on class with private methods count is more than thresholdInClasses option in detekt config, even if ignorePrivate option is set to true.

Steps to Reproduce

  1. Set to true ignoreDeprecated and ignorePrivate in TooManyFunctions rule.
  2. Write class with private functions count more than thresholdInClasses
  3. Run detekt check.

Your Environment

  • Version of detekt used: 1.0.0-RC12
  • Version of Gradle used (if applicable): 3.2.1
  • Operating System and version: macOS 10.12.6
  • Link to your project (if it's a public repository): private repo

I guess, the problem is here, isIgnoredFunction don't check function privacy if ignoreDeprecated is set to true, so ignorePrivate option is not being used.

@schalkms
Copy link
Member

Hey, thanks for reporting and also for investigating the problem.
The location in the source file is causing the problem as you said.
Do you mind to submit a pull request, since you have already looked into the problem?

@IvanAntsiferov
Copy link
Contributor Author

Do you mind to submit a pull request, since you have already looked into the problem?

Yes, I can do that next weekend.

@arturbosch
Copy link
Member

Cool, thank you!

@schalkms
Copy link
Member

schalkms commented Feb 4, 2019

Closed with 86cfcfb

@schalkms schalkms closed this as completed Feb 4, 2019
@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants