Grinnz / Perl-Critic-Community

Perl::Critic::Community - Community-inspired Perl::Critic policies
https://metacpan.org/pod/Perl::Critic::Community
Other
8 stars 10 forks source link

Indirect object method calls #1

Closed Grinnz closed 7 years ago

Grinnz commented 9 years ago

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

Grinnz commented 9 years ago

Going to have to wait for Perl::Critic::Dynamic to fix its tests. https://rt.cpan.org/Ticket/Display.html?id=103382

Grinnz commented 7 years ago

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.