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

[java] Improve CommentSize #4369

Merged
merged 1 commit into from
Jan 27, 2023
Merged

Conversation

oowekyala
Copy link
Member

@oowekyala oowekyala commented Jan 27, 2023

Rule: CommentSize

Describe the PR

  • CommentSize didn't report long lines on the right lines but always on the first line of the comment.
  • When counting the characters of long lines, the indentation (white space) is ignored as well as the comment markers at the beginning of the lines (e.g. *, //).

Related issues

  • Fixes #

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@jsotuyod jsotuyod added this to the 7.0.0 milestone Jan 27, 2023
@pmd-test
Copy link

2 Messages
📖 Compared to pmd/7.0.x:
This changeset changes 6 violations,
introduces 52834 new violations, 1 new errors and 0 new configuration errors,
removes 44 violations, 1438 errors and 0 configuration errors.
Full report
📖 Compared to master:
This changeset changes 50621 violations,
introduces 34682 new violations, 9 new errors and 0 new configuration errors,
removes 141951 violations, 4 errors and 7 configuration errors.
Full report

Generated by 🚫 Danger

@jsotuyod
Copy link
Member

Great finding!

Now that this is fixed however, it seems like a poor rule, specially regarding the "number of lines part"… at the very least I think Javadocs should be treated differently. I don't think there is any scenario were having "too much" javadoc is ever an issue, on the contrary, people usually complain for the lack of it…

I suggest we add a new property maxJavadocLines, with a more sensible default (ie: -1 to have no limit?)

@jsotuyod jsotuyod merged commit 0e19c2a into pmd:pmd/7.0.x Jan 27, 2023
@jsotuyod jsotuyod added the a:bug PMD crashes or fails to analyse a file. label Jan 27, 2023
@oowekyala oowekyala deleted the pmd7.fix-commentsize branch January 28, 2023 21:50
adangel added a commit to adangel/pmd that referenced this pull request Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants