← 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__