← 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/ControlStructures/ProhibitLabelsWithSpecialBlockNames.pm
StatementsExecuted 19 statements in 387µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11121µs25µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::BEGIN@12Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@12
11116µs16µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::BEGIN@10Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@10
11110µs208µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::BEGIN@16Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@16
11110µs36µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::BEGIN@14Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@14
1119µs74µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::BEGIN@17Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@17
1117µs18µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::BEGIN@11Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@11
1116µs7µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::default_severityPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::default_severity
1112µs2µsPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::supported_parametersPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::supported_parameters
0000s0sPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::applies_toPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::applies_to
0000s0sPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::default_themesPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::default_themes
0000s0sPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::::violatesPerl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::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::ControlStructures::ProhibitLabelsWithSpecialBlockNames;
9
10238µs116µs
# spent 16µs within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@10 which was called: # once (16µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11220µs228µs
# spent 18µs (7+11) within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@11 which was called: # once (7µs+11µs) by Module::Pluggable::Object::_require at line 11
use strict;
# spent 18µs making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@11 # spent 11µs making 1 call to strict::import
12226µs228µs
# spent 25µs (21+4) within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@12 which was called: # once (21µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
13
14234µs263µs
# spent 36µs (10+27) within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@14 which was called: # once (10µs+27µs) by Module::Pluggable::Object::_require at line 14
use Readonly;
15
16230µs2406µs
# spent 208µs (10+198) within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@16 which was called: # once (10µs+198µs) by Module::Pluggable::Object::_require at line 16
use Perl::Critic::Utils qw{ :severities hashify };
# spent 208µs making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@16 # spent 198µs making 1 call to Exporter::import
172219µs2139µs
# spent 74µs (9+65) within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@17 which was called: # once (9µs+65µs) by Module::Pluggable::Object::_require at line 17
use base 'Perl::Critic::Policy';
# spent 74µs making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::BEGIN@17 # spent 65µs making 1 call to base::import
18
191700nsour $VERSION = '1.121';
20
2115µs244µsReadonly::Hash my %SPECIAL_BLOCK_NAMES =>
# spent 39µs making 1 call to Readonly::Hash # spent 6µs making 1 call to Perl::Critic::Utils::hashify
22 hashify( qw< BEGIN END INIT CHECK UNITCHECK > );
23
24#-----------------------------------------------------------------------------
25
2611µs130µsReadonly::Scalar my $DESC => q<Special block name used as label.>;
# spent 30µs making 1 call to Readonly::Scalar
2711µs126µsReadonly::Scalar my $EXPL =>
# spent 26µs making 1 call to Readonly::Scalar
28 q<Use a label that cannot be confused with BEGIN, END, CHECK, INIT, or UNITCHECK blocks.>;
29
30#-----------------------------------------------------------------------------
31
3214µs
# spent 2µs within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::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 () }
3312µs
# spent 7µs (6+1) within Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::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 }
34sub default_themes { return qw< core bugs > }
35sub applies_to { return qw< PPI::Token::Label > }
36
37#-----------------------------------------------------------------------------
38
39sub violates {
40 my ($self, $elem, undef) = @_;
41
42 # Does the function call have enough arguments?
43 my $label = $elem->content();
44 $label =~ s/ \s* : \z //xms;
45 return if not $SPECIAL_BLOCK_NAMES{ $label };
46
47 return $self->violation( $DESC, $EXPL, $elem );
48}
49
50
5116µs1;
52
53#-----------------------------------------------------------------------------
54
55__END__