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

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/ValuesAndExpressions/ProhibitSpecialLiteralHeredocTerminator.pm
StatementsExecuted 18 statements in 348µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11117µs17µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::BEGIN@10Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@10
1118µs57µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::BEGIN@17Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@17
1118µs28µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::BEGIN@14Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@14
1117µs147µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::BEGIN@16Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@16
1117µs18µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::BEGIN@11Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@11
1117µs11µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::BEGIN@12Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@12
1116µs7µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::default_severityPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::default_severity
1115µs5µsPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::supported_parametersPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::supported_parameters
0000s0sPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::applies_toPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::applies_to
0000s0sPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::default_themesPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::default_themes
0000s0sPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::::violatesPerl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::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::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator;
9
10245µs117µs
# spent 17µs within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@10 which was called: # once (17µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11221µs230µs
# spent 18µs (7+11) within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@11 which was called: # once (7µs+11µs) by Module::Pluggable::Object::_require at line 11
use strict;
12218µs214µs
# spent 11µs (7+4) within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@12 which was called: # once (7µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
13
14222µs248µs
# spent 28µs (8+20) within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@14 which was called: # once (8µs+20µs) by Module::Pluggable::Object::_require at line 14
use Readonly;
15
16226µs2287µs
# spent 147µs (7+140) within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@16 which was called: # once (7µs+140µs) by Module::Pluggable::Object::_require at line 16
use Perl::Critic::Utils qw{ :severities };
172191µs2107µs
# spent 57µs (8+50) within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::BEGIN@17 which was called: # once (8µs+50µs) by Module::Pluggable::Object::_require at line 17
use base 'Perl::Critic::Policy';
18
191600nsour $VERSION = '1.121';
20
21#-----------------------------------------------------------------------------
22
2315µs131µsReadonly::Hash my %SPECIAL_LITERAL => map { '__' . $_ . '__' => 1 }
# spent 31µs making 1 call to Readonly::Hash
24 qw( FILE LINE PACKAGE END DATA );
2511µs123µsReadonly::Scalar my $DESC =>
# spent 23µs making 1 call to Readonly::Scalar
26 q{Heredoc terminator must not be a special literal};
27
28#-----------------------------------------------------------------------------
29
30113µs
# spent 5µs within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::supported_parameters which was called: # once (5µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm
sub supported_parameters { return () }
3112µs
# spent 7µs (6+1) within Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::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_MEDIUM }
32sub default_themes { return qw(core maintenance) }
33sub applies_to { return 'PPI::Token::HereDoc' }
34
35#-----------------------------------------------------------------------------
36
37sub violates {
38 my ( $self, $elem, undef ) = @_;
39
40 # remove << and (optional) quotes from around terminator
41 ( my $heredoc_terminator = $elem ) =~
42 s{ \A << \s* (["']?) (.*) \1 \z }{$2}xms;
43
44 if ( $SPECIAL_LITERAL{ $heredoc_terminator } ) {
45 my $expl = qq{Used "$heredoc_terminator" as heredoc terminator};
46 return $self->violation( $DESC, $expl, $elem );
47 }
48
49 return; #ok!
50}
51
5214µs1;
53
54__END__