Closed Grinnz closed 7 years ago
Going to have to wait for Perl::Critic::Dynamic to fix its tests. https://rt.cpan.org/Ticket/Display.html?id=103382
Rather than introducing a dynamic policy that requires additional action to use, I am adding a static policy subclassing Perl::Critic::Policy::Objects::ProhibitIndirectSyntax which will only detect the common 'new Foo' syntax.
Add a policy for indirect object method calls, with $HIGHEST severity. The problem with this is there's no reliable way to detect it without compiling the code, which means it will be a dynamic policy that requires
--allow-unsafe
.https://metacpan.org/pod/Perl::Critic::Policy::Dynamic::NoIndirect