yegor256 / qulice

Quality Police for Java projects: aggregator of Checkstyle and PMD
https://www.qulice.com
Other
300 stars 111 forks source link

AnonInnerLengthCheck inconsistent with lambdas #1076

Open andreoss opened 4 years ago

andreoss commented 4 years ago

A inner class of length above 20 is considered a violation:

    public Foo() {
        this(new Scalar<Bar>() {
            @Override
            public Bar value() throws Exception {
                   // Lengthy method
                }
            }
        });
    }

The same code but with lambda is considered okay

    public Foo() {
        this(() -> {
               // Lengthy method
            }
        });
    }

The feature request for checkstyle: https://github.com/checkstyle/checkstyle/issues/8341

0crat commented 4 years ago

@krzyk/z please, pay attention to this issue