| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Perl::Critic::TooMuchCode; |
|
2
|
5
|
|
|
5
|
|
511
|
use strict; |
|
|
5
|
|
|
|
|
11
|
|
|
|
5
|
|
|
|
|
1098
|
|
|
3
|
|
|
|
|
|
|
our $VERSION='0.18'; |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Well, we need a place for this monkey-patching business. |
|
6
|
|
|
|
|
|
|
sub __get_terop_usage { |
|
7
|
28
|
|
|
28
|
|
136
|
my ($used, $doc) = @_; |
|
8
|
28
|
100
|
|
818
|
|
67
|
for my $question_mark (@{ $doc->find( sub { $_[1]->isa('PPI::Token::Operator') && $_[1]->content eq '?' }) ||[]}) { |
|
|
28
|
100
|
|
|
|
166
|
|
|
|
818
|
|
|
|
|
10131
|
|
|
9
|
4
|
|
|
|
|
45
|
my $el = $question_mark->snext_sibling; |
|
10
|
4
|
100
|
|
|
|
211
|
next unless $el->isa('PPI::Token::Label'); |
|
11
|
|
|
|
|
|
|
|
|
12
|
3
|
|
|
|
|
11
|
my $tok = $el->content; |
|
13
|
3
|
|
|
|
|
37
|
$tok =~ s/\s*:\z//; |
|
14
|
|
|
|
|
|
|
|
|
15
|
3
|
|
|
|
|
15
|
$used->{$tok}++; |
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
|
20
|
|
|
|
|
|
|
__END__ |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Perl::Critic::TooMuchCode - perlcritic add-ons that generally check for dead code. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This add-on for L<Perl::Critic> is aiming for identifying trivial dead |
|
29
|
|
|
|
|
|
|
code. Either the ones that has no use, or the one that produce no |
|
30
|
|
|
|
|
|
|
effect. Having dead code floating around causes maintenance burden. Some |
|
31
|
|
|
|
|
|
|
might prefer not to generate them in the first place. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 AUTHOR |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Kang-min Liu <gugod@gugod.org> |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 LICENSE |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
MIT |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |