Skip to content

[java] LoD false positive #270

Closed
@jsotuyod

Description

@jsotuyod

Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex]. If not specific to a language, you can use [core]

Rule Set: java-coupling/LawOfDemeter

Description:

LoD reports a false positive when method calls are placed between the var declaration and assignment.

Code Sample demonstrating the issue:

public class Foo {
    public void example() {
        String something;
        C c = new C();
        c.doIt();
        something = "no worries";
    }
}

Running PMD through: Any

Placeholder report for PR #266

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:bugPMD crashes or fails to analyse a file.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions