Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/InputOutput/ProhibitReadlineInForLoop.pm |
Statements | Executed 20 statements in 691µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 21µs | 21µs | BEGIN@10 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 17µs | 55µs | BEGIN@15 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 12µs | 17µs | BEGIN@12 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 11µs | 44µs | BEGIN@13 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 9µs | 25µs | BEGIN@11 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 9µs | 208µs | BEGIN@17 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 8µs | 72µs | BEGIN@18 | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 7µs | 9µs | default_severity | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
1 | 1 | 1 | 2µs | 2µs | supported_parameters | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
0 | 0 | 0 | 0s | 0s | __ANON__[:41] | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
0 | 0 | 0 | 0s | 0s | applies_to | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
0 | 0 | 0 | 0s | 0s | violates | Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | ############################################################################## | ||||
2 | # $URL$ | ||||
3 | # $Date$ | ||||
4 | # $Author$ | ||||
5 | # $Revision$ | ||||
6 | ############################################################################## | ||||
7 | |||||
8 | package Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop; | ||||
9 | |||||
10 | 2 | 53µs | 1 | 21µs | # spent 21µs within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@10 which was called:
# once (21µs+0s) by Module::Pluggable::Object::_require at line 10 # spent 21µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@10 |
11 | 2 | 298µs | 2 | 41µs | # spent 25µs (9+16) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@11 which was called:
# once (9µs+16µs) by Module::Pluggable::Object::_require at line 11 # spent 25µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@11
# spent 16µs making 1 call to strict::import |
12 | 2 | 27µs | 2 | 23µs | # spent 17µs (12+5) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@12 which was called:
# once (12µs+5µs) by Module::Pluggable::Object::_require at line 12 # spent 17µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@12
# spent 5µs making 1 call to warnings::import |
13 | 2 | 30µs | 2 | 77µs | # spent 44µs (11+33) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@13 which was called:
# once (11µs+33µs) by Module::Pluggable::Object::_require at line 13 # spent 44µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@13
# spent 33µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 33µs | 2 | 67µs | # spent 55µs (17+38) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@15 which was called:
# once (17µs+38µs) by Module::Pluggable::Object::_require at line 15 # spent 55µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@15
# spent 13µs making 1 call to List::Util::import |
16 | |||||
17 | 2 | 26µs | 2 | 407µs | # spent 208µs (9+199) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@17 which was called:
# once (9µs+199µs) by Module::Pluggable::Object::_require at line 17 # spent 208µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@17
# spent 199µs making 1 call to Exporter::import |
18 | 2 | 208µs | 2 | 135µs | # spent 72µs (8+63) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@18 which was called:
# once (8µs+63µs) by Module::Pluggable::Object::_require at line 18 # spent 72µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@18
# spent 63µs making 1 call to base::import |
19 | |||||
20 | 1 | 600ns | our $VERSION = '1.121'; | ||
21 | |||||
22 | #----------------------------------------------------------------------------- | ||||
23 | |||||
24 | 1 | 2µs | 1 | 33µs | Readonly::Scalar my $DESC => q{Readline inside "for" loop}; # spent 33µs making 1 call to Readonly::Scalar |
25 | 1 | 2µs | 1 | 49µs | Readonly::Scalar my $EXPL => [ 211 ]; # spent 49µs making 1 call to Readonly::Scalar |
26 | |||||
27 | #----------------------------------------------------------------------------- | ||||
28 | |||||
29 | 1 | 6µs | # spent 2µs within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::supported_parameters which was called:
# once (2µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||
30 | 1 | 2µs | # spent 9µs (7+2) within Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::default_severity which was called:
# once (7µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
31 | sub default_themes { return qw< core bugs pbp > } | ||||
32 | sub applies_to { return qw< PPI::Statement::Compound > } | ||||
33 | |||||
34 | #----------------------------------------------------------------------------- | ||||
35 | |||||
36 | sub violates { | ||||
37 | my ( $self, $elem, undef ) = @_; | ||||
38 | |||||
39 | return if $elem->type() ne 'foreach'; | ||||
40 | |||||
41 | my $list = first { $_->isa('PPI::Structure::List') } $elem->schildren() | ||||
42 | or return; | ||||
43 | |||||
44 | if ( | ||||
45 | my $readline = $list->find_first('PPI::Token::QuoteLike::Readline') | ||||
46 | ) { | ||||
47 | return $self->violation( $DESC, $EXPL, $readline ); | ||||
48 | } | ||||
49 | |||||
50 | return; #ok! | ||||
51 | } | ||||
52 | |||||
53 | 1 | 4µs | 1; | ||
54 | |||||
55 | __END__ |