← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:12 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/InputOutput/ProhibitReadlineInForLoop.pm
StatementsExecuted 20 statements in 691µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11121µs21µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@10Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@10
11117µs55µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@15Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@15
11112µs17µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@12Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@12
11111µs44µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@13Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@13
1119µs25µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@11Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@11
1119µs208µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@17Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@17
1118µs72µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::BEGIN@18Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@18
1117µs9µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::default_severityPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::default_severity
1112µs2µsPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::supported_parametersPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::supported_parameters
0000s0sPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::__ANON__[:41]Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::__ANON__[:41]
0000s0sPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::applies_toPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::applies_to
0000s0sPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::default_themesPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::default_themes
0000s0sPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::::violatesPerl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::violates
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1##############################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6##############################################################################
7
8package Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop;
9
10253µs121µ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
use 5.006001;
112298µs241µ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
use strict;
# spent 25µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@11 # spent 16µs making 1 call to strict::import
12227µs223µ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
use warnings;
# spent 17µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@12 # spent 5µs making 1 call to warnings::import
13230µs277µ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
use Readonly;
# spent 44µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@13 # spent 33µs making 1 call to Exporter::import
14
15233µs267µ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
use List::Util qw< first >;
# 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
17226µs2407µ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
use Perl::Critic::Utils qw{ :severities };
# spent 208µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@17 # spent 199µs making 1 call to Exporter::import
182208µs2135µ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
use base 'Perl::Critic::Policy';
# spent 72µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::BEGIN@18 # spent 63µs making 1 call to base::import
19
201600nsour $VERSION = '1.121';
21
22#-----------------------------------------------------------------------------
23
2412µs133µsReadonly::Scalar my $DESC => q{Readline inside "for" loop};
# spent 33µs making 1 call to Readonly::Scalar
2512µs149µsReadonly::Scalar my $EXPL => [ 211 ];
# spent 49µs making 1 call to Readonly::Scalar
26
27#-----------------------------------------------------------------------------
28
2916µ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
sub supported_parameters { return () }
3012µ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
sub default_severity { return $SEVERITY_HIGH }
31sub default_themes { return qw< core bugs pbp > }
32sub applies_to { return qw< PPI::Statement::Compound > }
33
34#-----------------------------------------------------------------------------
35
36sub 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
5314µs1;
54
55__END__