← 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/PolicyConfig.pm
StatementsExecuted 8306 statements in 20.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
141118.11ms101msPerl::Critic::PolicyConfig::::handle_extra_parametersPerl::Critic::PolicyConfig::handle_extra_parameters
282223.88ms4.59msPerl::Critic::PolicyConfig::::newPerl::Critic::PolicyConfig::new
564412.21ms2.82msPerl::Critic::PolicyConfig::::_get_non_public_dataPerl::Critic::PolicyConfig::_get_non_public_data
14111922┬Ás2.40msPerl::Critic::PolicyConfig::::is_maximum_violations_per_document_unlimitedPerl::Critic::PolicyConfig::is_maximum_violations_per_document_unlimited
14111900┬Ás1.10msPerl::Critic::PolicyConfig::::get_parameter_namesPerl::Critic::PolicyConfig::get_parameter_names
14111664┬Ás816┬ÁsPerl::Critic::PolicyConfig::::set_profile_strictnessPerl::Critic::PolicyConfig::set_profile_strictness
9711496┬Ás614┬ÁsPerl::Critic::PolicyConfig::::removePerl::Critic::PolicyConfig::remove
111461┬Ás1.49msPerl::Critic::PolicyConfig::::BEGIN@20Perl::Critic::PolicyConfig::BEGIN@20
14111453┬Ás1.28msPerl::Critic::PolicyConfig::::get_maximum_violations_per_documentPerl::Critic::PolicyConfig::get_maximum_violations_per_document
111429┬Ás1.99msPerl::Critic::PolicyConfig::::BEGIN@19Perl::Critic::PolicyConfig::BEGIN@19
14111426┬Ás1.12msPerl::Critic::PolicyConfig::::get_severityPerl::Critic::PolicyConfig::get_severity
14111418┬Ás1.07msPerl::Critic::PolicyConfig::::get_set_themesPerl::Critic::PolicyConfig::get_set_themes
14111400┬Ás1.03msPerl::Critic::PolicyConfig::::get_add_themesPerl::Critic::PolicyConfig::get_add_themes
11115┬Ás15┬ÁsPerl::Critic::PolicyConfig::::BEGIN@10Perl::Critic::PolicyConfig::BEGIN@10
11113┬Ás176┬ÁsPerl::Critic::PolicyConfig::::BEGIN@22Perl::Critic::PolicyConfig::BEGIN@22
11111┬Ás489┬ÁsPerl::Critic::PolicyConfig::::BEGIN@21Perl::Critic::PolicyConfig::BEGIN@21
1117┬Ás11┬ÁsPerl::Critic::PolicyConfig::::BEGIN@12Perl::Critic::PolicyConfig::BEGIN@12
1117┬Ás22┬ÁsPerl::Critic::PolicyConfig::::BEGIN@18Perl::Critic::PolicyConfig::BEGIN@18
1117┬Ás26┬ÁsPerl::Critic::PolicyConfig::::BEGIN@14Perl::Critic::PolicyConfig::BEGIN@14
1117┬Ás18┬ÁsPerl::Critic::PolicyConfig::::BEGIN@11Perl::Critic::PolicyConfig::BEGIN@11
0000s0sPerl::Critic::PolicyConfig::::getPerl::Critic::PolicyConfig::get
0000s0sPerl::Critic::PolicyConfig::::get_policy_short_namePerl::Critic::PolicyConfig::get_policy_short_name
0000s0sPerl::Critic::PolicyConfig::::is_emptyPerl::Critic::PolicyConfig::is_empty
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::PolicyConfig;
9
10237┬Ás115┬Ás
# spent 15┬Ás within Perl::Critic::PolicyConfig::BEGIN@10 which was called: # once (15┬Ás+0s) by Perl::Critic::PolicyFactory::BEGIN@27 at line 10
use 5.006001;
# spent 15┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@10
11222┬Ás229┬Ás
# spent 18┬Ás (7+11) within Perl::Critic::PolicyConfig::BEGIN@11 which was called: # once (7┬Ás+11┬Ás) by Perl::Critic::PolicyFactory::BEGIN@27 at line 11
use strict;
# spent 18┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@11 # spent 11┬Ás making 1 call to strict::import
12218┬Ás215┬Ás
# spent 11┬Ás (7+4) within Perl::Critic::PolicyConfig::BEGIN@12 which was called: # once (7┬Ás+4┬Ás) by Perl::Critic::PolicyFactory::BEGIN@27 at line 12
use warnings;
# spent 11┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@12 # spent 4┬Ás making 1 call to warnings::import
13
14227┬Ás246┬Ás
# spent 26┬Ás (7+20) within Perl::Critic::PolicyConfig::BEGIN@14 which was called: # once (7┬Ás+20┬Ás) by Perl::Critic::PolicyFactory::BEGIN@27 at line 14
use Readonly;
# spent 26┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@14 # spent 20┬Ás making 1 call to Exporter::import
15
161900nsour $VERSION = '1.121';
17
18219┬Ás238┬Ás
# spent 22┬Ás (7+15) within Perl::Critic::PolicyConfig::BEGIN@18 which was called: # once (7┬Ás+15┬Ás) by Perl::Critic::PolicyFactory::BEGIN@27 at line 18
use Perl::Critic::Exception::AggregateConfiguration;
# spent 22┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@18 # spent 15┬Ás making 1 call to Exporter::import
192120┬Ás22.02ms
# spent 1.99ms (429┬Ás+1.56) within Perl::Critic::PolicyConfig::BEGIN@19 which was called: # once (429┬Ás+1.56ms) by Perl::Critic::PolicyFactory::BEGIN@27 at line 19
use Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue;
# spent 1.99ms making 1 call to Perl::Critic::PolicyConfig::BEGIN@19 # spent 24┬Ás making 1 call to Exporter::import
202167┬Ás21.51ms
# spent 1.49ms (461┬Ás+1.03) within Perl::Critic::PolicyConfig::BEGIN@20 which was called: # once (461┬Ás+1.03ms) by Perl::Critic::PolicyFactory::BEGIN@27 at line 20
use Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter;
# spent 1.49ms making 1 call to Perl::Critic::PolicyConfig::BEGIN@20 # spent 24┬Ás making 1 call to Exporter::import
21239┬Ás2967┬Ás
# spent 489┬Ás (11+478) within Perl::Critic::PolicyConfig::BEGIN@21 which was called: # once (11┬Ás+478┬Ás) by Perl::Critic::PolicyFactory::BEGIN@27 at line 21
use Perl::Critic::Utils qw< :booleans :characters severity_to_number >;
# spent 489┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@21 # spent 478┬Ás making 1 call to Exporter::import
222870┬Ás2339┬Ás
# spent 176┬Ás (13+163) within Perl::Critic::PolicyConfig::BEGIN@22 which was called: # once (13┬Ás+163┬Ás) by Perl::Critic::PolicyFactory::BEGIN@27 at line 22
use Perl::Critic::Utils::Constants qw< :profile_strictness >;
# spent 176┬Ás making 1 call to Perl::Critic::PolicyConfig::BEGIN@22 # spent 163┬Ás making 1 call to Exporter::import
23
24#-----------------------------------------------------------------------------
25
2613┬Ás145┬ÁsReadonly::Scalar my $NON_PUBLIC_DATA => '_non_public_data';
# spent 45┬Ás making 1 call to Readonly::Scalar
2711┬Ás130┬ÁsReadonly::Scalar my $NO_LIMIT => 'no_limit';
# spent 30┬Ás making 1 call to Readonly::Scalar
28
29#-----------------------------------------------------------------------------
30
31
# spent 4.59ms (3.88+704┬Ás) within Perl::Critic::PolicyConfig::new which was called 282 times, avg 16┬Ás/call: # 141 times (2.03ms+340┬Ás) by Perl::Critic::UserProfile::policy_params at line 66 of Perl/Critic/UserProfile.pm, avg 17┬Ás/call # 141 times (1.85ms+364┬Ás) by Perl::Critic::Policy::new at line 72 of Perl/Critic/Policy.pm, avg 16┬Ás/call
sub new {
32282103┬Ás my ($class, $policy_short_name, $specification) = @_;
33
34282267┬Ás my %self = $specification ? %{ $specification } : ();
3528230┬Ás my %non_public_data;
36
37282170┬Ás $non_public_data{_policy_short_name} = $policy_short_name;
38282701┬Ás282353┬Ás $non_public_data{_profile_strictness} =
# spent 353┬Ás making 282 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
39 $self{$NON_PUBLIC_DATA}{_profile_strictness};
40
41282154┬Ás foreach my $standard_parameter (
42 qw< maximum_violations_per_document severity set_themes add_themes >
43 ) {
441128343┬Ás if ( exists $self{$standard_parameter} ) {
45 $non_public_data{"_$standard_parameter"} =
46 delete $self{$standard_parameter};
47 }
48 }
49
50282615┬Ás282351┬Ás $self{$NON_PUBLIC_DATA} = \%non_public_data;
# spent 351┬Ás making 282 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
51
52
53282744┬Ás return bless \%self, $class;
54}
55
56#-----------------------------------------------------------------------------
57
58
# spent 2.82ms (2.21+606┬Ás) within Perl::Critic::PolicyConfig::_get_non_public_data which was called 564 times, avg 5┬Ás/call: # 141 times (654┬Ás+178┬Ás) by Perl::Critic::PolicyConfig::get_maximum_violations_per_document at line 118, avg 6┬Ás/call # 141 times (550┬Ás+146┬Ás) by Perl::Critic::PolicyConfig::get_severity at line 93, avg 5┬Ás/call # 141 times (513┬Ás+144┬Ás) by Perl::Critic::PolicyConfig::get_set_themes at line 77, avg 5┬Ás/call # 141 times (495┬Ás+139┬Ás) by Perl::Critic::PolicyConfig::get_add_themes at line 85, avg 4┬Ás/call
sub _get_non_public_data {
5956472┬Ás my $self = shift;
60
615641.90ms564606┬Ás return $self->{$NON_PUBLIC_DATA};
# spent 606┬Ás making 564 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
62}
63
64#-----------------------------------------------------------------------------
65
66sub get_policy_short_name {
67 my $self = shift;
68
69 return $self->_get_non_public_data()->{_policy_short_name};
70}
71
72#-----------------------------------------------------------------------------
73
74
# spent 1.07ms (418┬Ás+657┬Ás) within Perl::Critic::PolicyConfig::get_set_themes which was called 141 times, avg 8┬Ás/call: # 141 times (418┬Ás+657┬Ás) by Perl::Critic::Policy::__set_base_parameters at line 169 of Perl/Critic/Policy.pm, avg 8┬Ás/call
sub get_set_themes {
7514117┬Ás my ($self) = @_;
76
77141323┬Ás141657┬Ás return $self->_get_non_public_data()->{_set_themes};
# spent 657┬Ás making 141 calls to Perl::Critic::PolicyConfig::_get_non_public_data, avg 5┬Ás/call
78}
79
80#-----------------------------------------------------------------------------
81
82
# spent 1.03ms (400┬Ás+634┬Ás) within Perl::Critic::PolicyConfig::get_add_themes which was called 141 times, avg 7┬Ás/call: # 141 times (400┬Ás+634┬Ás) by Perl::Critic::Policy::__set_base_parameters at line 175 of Perl/Critic/Policy.pm, avg 7┬Ás/call
sub get_add_themes {
8314117┬Ás my ($self) = @_;
84
851413.47ms141634┬Ás return $self->_get_non_public_data()->{_add_themes};
# spent 634┬Ás making 141 calls to Perl::Critic::PolicyConfig::_get_non_public_data, avg 4┬Ás/call
86}
87
88#-----------------------------------------------------------------------------
89
90
# spent 1.12ms (426┬Ás+696┬Ás) within Perl::Critic::PolicyConfig::get_severity which was called 141 times, avg 8┬Ás/call: # 141 times (426┬Ás+696┬Ás) by Perl::Critic::Policy::__set_base_parameters at line 163 of Perl/Critic/Policy.pm, avg 8┬Ás/call
sub get_severity {
9114123┬Ás my ($self) = @_;
92
93141330┬Ás141696┬Ás return $self->_get_non_public_data()->{_severity};
# spent 696┬Ás making 141 calls to Perl::Critic::PolicyConfig::_get_non_public_data, avg 5┬Ás/call
94}
95
96#-----------------------------------------------------------------------------
97
98
# spent 2.40ms (922┬Ás+1.48) within Perl::Critic::PolicyConfig::is_maximum_violations_per_document_unlimited which was called 141 times, avg 17┬Ás/call: # 141 times (922┬Ás+1.48ms) by Perl::Critic::Policy::_set_maximum_violations_per_document at line 195 of Perl/Critic/Policy.pm, avg 17┬Ás/call
sub is_maximum_violations_per_document_unlimited {
9914117┬Ás my ($self) = @_;
100
101141173┬Ás1411.28ms my $maximum_violations = $self->get_maximum_violations_per_document();
# spent 1.28ms making 141 calls to Perl::Critic::PolicyConfig::get_maximum_violations_per_document, avg 9┬Ás/call
102141269┬Ás if (
103 not defined $maximum_violations
104 or $maximum_violations eq $EMPTY
105 or $maximum_violations =~ m<\A $NO_LIMIT \z>xmsio
106 ) {
107 return $TRUE;
108 }
109
110 return $FALSE;
111}
112
113#-----------------------------------------------------------------------------
114
115
# spent 1.28ms (453┬Ás+832┬Ás) within Perl::Critic::PolicyConfig::get_maximum_violations_per_document which was called 141 times, avg 9┬Ás/call: # 141 times (453┬Ás+832┬Ás) by Perl::Critic::PolicyConfig::is_maximum_violations_per_document_unlimited at line 101, avg 9┬Ás/call
sub get_maximum_violations_per_document {
11614116┬Ás my ($self) = @_;
117
118141369┬Ás141832┬Ás return $self->_get_non_public_data()->{_maximum_violations_per_document};
# spent 832┬Ás making 141 calls to Perl::Critic::PolicyConfig::_get_non_public_data, avg 6┬Ás/call
119}
120
121#-----------------------------------------------------------------------------
122
123sub get {
124 my ($self, $parameter) = @_;
125
126 return if $parameter eq $NON_PUBLIC_DATA;
127
128 return $self->{$parameter};
129}
130
131#-----------------------------------------------------------------------------
132
133
# spent 614┬Ás (496+117) within Perl::Critic::PolicyConfig::remove which was called 97 times, avg 6┬Ás/call: # 97 times (496┬Ás+117┬Ás) by Perl::Critic::Policy::new at line 103 of Perl/Critic/Policy.pm, avg 6┬Ás/call
sub remove {
1349725┬Ás my ($self, $parameter) = @_;
135
13697209┬Ás97117┬Ás return if $parameter eq $NON_PUBLIC_DATA;
# spent 117┬Ás making 97 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
137
1389729┬Ás delete $self->{$parameter};
139
14097151┬Ás return;
141}
142
143#-----------------------------------------------------------------------------
144
145sub is_empty {
146 my ($self) = @_;
147
148 return 1 >= keys %{$self};
149}
150
151#-----------------------------------------------------------------------------
152
153
# spent 1.10ms (900┬Ás+203┬Ás) within Perl::Critic::PolicyConfig::get_parameter_names which was called 141 times, avg 8┬Ás/call: # 141 times (900┬Ás+203┬Ás) by Perl::Critic::PolicyConfig::handle_extra_parameters at line 173, avg 8┬Ás/call
sub get_parameter_names {
15414130┬Ás my ($self) = @_;
155
156141765┬Ás141203┬Ás return grep { $_ ne $NON_PUBLIC_DATA } keys %{$self};
# spent 203┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
157}
158
159#-----------------------------------------------------------------------------
160
161
# spent 101ms (8.11+92.9) within Perl::Critic::PolicyConfig::handle_extra_parameters which was called 141 times, avg 716┬Ás/call: # 141 times (8.11ms+92.9ms) by Perl::Critic::Policy::new at line 106 of Perl/Critic/Policy.pm, avg 716┬Ás/call
sub handle_extra_parameters {
16214136┬Ás my ($self, $policy, $errors) = @_;
163
164141363┬Ás141176┬Ás my $profile_strictness = $self->{$NON_PUBLIC_DATA}{_profile_strictness};
# spent 176┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
16514122┬Ás defined $profile_strictness
166 or $profile_strictness = $PROFILE_STRICTNESS_DEFAULT;
167
168141274┬Ás141169┬Ás return if $profile_strictness eq $PROFILE_STRICTNESS_QUIET;
# spent 169┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
169
170141454┬Ás28290.6ms my $parameter_errors = $profile_strictness eq $PROFILE_STRICTNESS_WARN ?
# spent 90.5ms making 141 calls to Perl::Critic::Exception::AggregateConfiguration::new, avg 642┬Ás/call # spent 160┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
171 Perl::Critic::Exception::AggregateConfiguration->new() : $errors;
172
173141339┬Ás1411.10ms foreach my $offered_param ( $self->get_parameter_names() ) {
# spent 1.10ms making 141 calls to Perl::Critic::PolicyConfig::get_parameter_names, avg 8┬Ás/call
174 $parameter_errors->add_exception(
175 Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter->new(
176 policy => $policy->get_short_name(),
177 option_name => $offered_param,
178 source => undef,
179 )
180 );
181 }
182
183141424┬Ás282847┬Ás warn qq<$parameter_errors\n>
# spent 673┬Ás making 141 calls to Perl::Critic::Exception::AggregateConfiguration::has_exceptions, avg 5┬Ás/call # spent 173┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
184 if ($profile_strictness eq $PROFILE_STRICTNESS_WARN
185 && $parameter_errors->has_exceptions());
186
1871415.13ms return;
188}
189
190#-----------------------------------------------------------------------------
191
192
# spent 816┬Ás (664+152) within Perl::Critic::PolicyConfig::set_profile_strictness which was called 141 times, avg 6┬Ás/call: # 141 times (664┬Ás+152┬Ás) by Perl::Critic::PolicyFactory::_instantiate_policy at line 258 of Perl/Critic/PolicyFactory.pm, avg 6┬Ás/call
sub set_profile_strictness {
19314130┬Ás my ($self, $profile_strictness) = @_;
194
195141302┬Ás141152┬Ás $self->{$NON_PUBLIC_DATA}{_profile_strictness} = $profile_strictness;
# spent 152┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
196
197141244┬Ás return;
198}
199
200#-----------------------------------------------------------------------------
201
20215┬Ás1;
203
204__END__