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

Same method invocation within a chain of invocation (fluent interface) #142

Open
2 tasks
dgroup opened this issue May 6, 2022 · 0 comments
Open
2 tasks
Assignees

Comments

@dgroup
Copy link
Owner

dgroup commented May 6, 2022

Summary

Key Value
Rule AvoidSameMethodInvocationInChain
arch4u version 0.3.0

Your rule definition

<rule name="AvoidSameMethodInvocationInChain"
      since="0.3.0"
      language="java"
      externalInfoUrl="https://github.com/dgroup/arch4u-pmd/discussions/..."
      message="Avoid same method invocation in chain: https://github.com/dgroup/arch4u-pmd/discussions/..."
      class="io.github.dgroup.arch4u.pmd.AvoidSameMethodInvocationInChain">
    <priority>3</priority>
    <properties>
      <property name="allowedMethods" value="to"/>
    </properties>
</rule>

Describe the defect or false/positive rule violation

  • Case 1: method description invoked twice
        rest()
            .post("/tbd")
            .id("tbd-endpoint").description("TBD endpoint")
            .description("TBD endpoint again ") //violation here 
            .consumes(MediaType.APPLICATION_JSON_VALUE)
            .produces(MediaType.APPLICATION_JSON_VALUE)
  • Case 2: method to is allowed
        rest()
            .post("/tbd")
            .id("tbd-endpoint")
            .description("tbd endpoint")
            .consumes(MediaType.APPLICATION_JSON_VALUE)
            .produces(MediaType.APPLICATION_JSON_VALUE)
            .to("tbd 1")
            .to("tbd 2")
@dgroup dgroup self-assigned this May 6, 2022
@dgroup dgroup modified the milestones: 0.3.0, 0.2.3 May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant