← 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:13 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/BuiltinFunctions/RequireBlockGrep.pm
StatementsExecuted 18 statements in 301µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11119µs19µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::BEGIN@14Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@14
1118µs63µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::BEGIN@20Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@20
1117µs426µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::BEGIN@19Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@19
1117µs27µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::BEGIN@17Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@17
1117µs18µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::BEGIN@15Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@15
1117µs11µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::BEGIN@16Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@16
1116µs7µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::default_severityPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::default_severity
1113µs3µsPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::supported_parametersPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::supported_parameters
0000s0sPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::applies_toPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::applies_to
0000s0sPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::default_themesPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::default_themes
0000s0sPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::::violatesPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::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::BuiltinFunctions::RequireBlockGrep;
9
10# DEVELOPER NOTE: this module is used as an example in DEVELOPER.pod.
11# If you make changes in here, please reflect those changes in the
12# examples.
13
14242µs119µs
# spent 19µs within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@14 which was called: # once (19µs+0s) by Module::Pluggable::Object::_require at line 14
use 5.006001;
15220µs229µs
# spent 18µs (7+11) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@15 which was called: # once (7µs+11µs) by Module::Pluggable::Object::_require at line 15
use strict;
# spent 18µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@15 # spent 11µs making 1 call to strict::import
16218µs216µs
# spent 11µs (7+4) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@16 which was called: # once (7µs+4µs) by Module::Pluggable::Object::_require at line 16
use warnings;
# spent 11µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@16 # spent 4µs making 1 call to warnings::import
17226µs247µs
# spent 27µs (7+20) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@17 which was called: # once (7µs+20µs) by Module::Pluggable::Object::_require at line 17
use Readonly;
# spent 27µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@17 # spent 20µs making 1 call to Exporter::import
18
19225µs2845µs
# spent 426µs (7+419) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@19 which was called: # once (7µs+419µs) by Module::Pluggable::Object::_require at line 19
use Perl::Critic::Utils qw{ :severities :classification :ppi };
# spent 426µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@19 # spent 419µs making 1 call to Exporter::import
202155µs2119µs
# spent 63µs (8+56) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@20 which was called: # once (8µs+56µs) by Module::Pluggable::Object::_require at line 20
use base 'Perl::Critic::Policy';
# spent 63µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@20 # spent 56µs making 1 call to base::import
21
221600nsour $VERSION = '1.121';
23
24#-----------------------------------------------------------------------------
25
2612µs128µsReadonly::Scalar my $DESC => q{Expression form of "grep"};
# spent 28µs making 1 call to Readonly::Scalar
2712µs144µsReadonly::Scalar my $EXPL => [ 169 ];
# spent 44µs making 1 call to Readonly::Scalar
28
29#-----------------------------------------------------------------------------
30
3116µs
# spent 3µs within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::supported_parameters which was called: # once (3µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm
sub supported_parameters { return () }
3212µs
# spent 7µs (6+1) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::default_severity which was called: # once (6µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm
sub default_severity { return $SEVERITY_HIGH }
33sub default_themes { return qw( core bugs pbp ) }
34sub applies_to { return 'PPI::Token::Word' }
35
36#-----------------------------------------------------------------------------
37
38sub violates {
39 my ( $self, $elem, undef ) = @_;
40
41 return if $elem ne 'grep';
42 return if ! is_function_call($elem);
43
44 my $arg = first_arg($elem);
45 return if !$arg;
46 return if $arg->isa('PPI::Structure::Block');
47
48 return $self->violation( $DESC, $EXPL, $elem );
49}
50
5113µs1;
52
53__END__