GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] TooManyMethods - improve getter/setter detection (#3729) by 341816041 · Pull Request #3994 · pmd/pmd

Conversation

@341816041

@341816041 341816041 commented May 29, 2022 •
edited by adangel
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Describe the PR

Add a condition for judging a method as a getter setter

Related issues

  • Fixes [java] TooManyMethods ignores "real" methods which are named like getters or setters #3729

Ready?

  • [1] Added unit tests for fixed bug/feature
  • [0] Passing all unit tests
  • [0] Complete build ./mvnw clean verify passes (checked automatically by github actions)(it goes wrong at disk test)
  • [0] Added (in-code) documentation (if needed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
341816041 and others added 2 commits May 29, 2022 22:43
@341816041
handle issue 3729
3c1a246
@341816041
Update design.xml
7f5f040
@ghost

ghost commented Jun 1, 2022 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 329 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 2 errors and 0 configuration errors.
Full report
✅ Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 2 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel changed the title handle issue 3729 [java] TooManyMethods - improve getter/setter detection (#3729) Jun 2, 2022
adangel
adangel requested changes Jun 2, 2022
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Can you have a look at your fix? I don't think it actually fixes the problem... We don't detect too many methods even for your test case, where we have 22 methods...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/TooManyMethods.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel added this to the 6.48.0 milestone Jun 23, 2022
adangel added 4 commits July 7, 2022 09:49
@adangel
Merge branch 'master' into pr-3994
5fa2a6b
@adangel
[java] Improve TooManyMethods (pmd#3994)
8f3c7ee
@adangel
Add @341816041 as a contributor
53747dd
@adangel
[doc] Update release notes (pmd#3729, pmd#3994)
71b5855
@adangel adangel self-assigned this Jul 7, 2022
@adangel
adangel merged commit c83987f into pmd:master Jul 7, 2022
@C-Otto

C-Otto commented Jul 31, 2022

Copy link
Copy Markdown

I just noticed that the documentation in https://pmd.github.io/latest/pmd_rules_plsql_design.html still includes the exclusion of get/set/is methods. Could you please update it, too?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel

adangel commented Aug 2, 2022

Copy link
Copy Markdown
Member

@C-Otto The file you mention is about PLSQL - the java version is updated: https://pmd.github.io/latest/pmd_rules_java_design.html#toomanymethods

still includes the exclusion of get/set/is methods

That's the whole point - exclude getter/setter/methods from the TooManyMethods rule, but keep e.g. getters, that do more (that's the count(Block/BlockStatement) <= 1 condition).

Please create a new issue, if you think, something is wrong. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@C-Otto

C-Otto commented Aug 2, 2022

Copy link
Copy Markdown

Everything is fine, sorry for the confusion!

adangel reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@adangel adangel adangel requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adangel adangel

Labels

None yet

Projects

None yet

Milestone

6.48.0

Development

Successfully merging this pull request may close these issues.

[java] TooManyMethods ignores "real" methods which are named like getters or setters

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@341816041 @C-Otto @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.