← 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/Violation.pm
StatementsExecuted 569 statements in 3.62ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.47ms2.59msPerl::Critic::Violation::::BEGIN@19Perl::Critic::Violation::BEGIN@19
1112.41ms4.75msPerl::Critic::Violation::::BEGIN@26Perl::Critic::Violation::BEGIN@26
1111.17ms1.34msPerl::Critic::Violation::::BEGIN@17Perl::Critic::Violation::BEGIN@17
14411907┬Ás1.07msPerl::Critic::Violation::::sort_by_locationPerl::Critic::Violation::sort_by_location
111436┬Ás599┬ÁsPerl::Critic::Violation::::BEGIN@21Perl::Critic::Violation::BEGIN@21
111362┬Ás871┬ÁsPerl::Critic::Violation::::BEGIN@30Perl::Critic::Violation::BEGIN@30
14411160┬Ás160┬ÁsPerl::Critic::Violation::::CORE:sortPerl::Critic::Violation::CORE:sort (opcode)
311155┬Ás817┬ÁsPerl::Critic::Violation::::newPerl::Critic::Violation::new
31177┬Ás468┬ÁsPerl::Critic::Violation::::_line_containing_violationPerl::Critic::Violation::_line_containing_violation
31127┬Ás29┬ÁsPerl::Critic::Violation::::_chomp_periodsPerl::Critic::Violation::_chomp_periods
11115┬Ás15┬ÁsPerl::Critic::Violation::::BEGIN@10Perl::Critic::Violation::BEGIN@10
1119┬Ás32┬ÁsPerl::Critic::Violation::::BEGIN@20Perl::Critic::Violation::BEGIN@20
1118┬Ás369┬ÁsPerl::Critic::Violation::::BEGIN@14Perl::Critic::Violation::BEGIN@14
1118┬Ás34┬ÁsPerl::Critic::Violation::::BEGIN@23Perl::Critic::Violation::BEGIN@23
1118┬Ás27┬ÁsPerl::Critic::Violation::::BEGIN@15Perl::Critic::Violation::BEGIN@15
1117┬Ás283┬ÁsPerl::Critic::Violation::::BEGIN@25Perl::Critic::Violation::BEGIN@25
1117┬Ás19┬ÁsPerl::Critic::Violation::::BEGIN@11Perl::Critic::Violation::BEGIN@11
1117┬Ás11┬ÁsPerl::Critic::Violation::::BEGIN@12Perl::Critic::Violation::BEGIN@12
3116┬Ás6┬ÁsPerl::Critic::Violation::::locationPerl::Critic::Violation::location
3115┬Ás5┬ÁsPerl::Critic::Violation::::CORE:qrPerl::Critic::Violation::CORE:qr (opcode)
3114┬Ás4┬ÁsPerl::Critic::Violation::::CORE:regcompPerl::Critic::Violation::CORE:regcomp (opcode)
1114┬Ás4┬ÁsPerl::Critic::Violation::::BEGIN@18Perl::Critic::Violation::BEGIN@18
3112┬Ás2┬ÁsPerl::Critic::Violation::::CORE:substPerl::Critic::Violation::CORE:subst (opcode)
0000s0sPerl::Critic::Violation::::__ANON__[:265]Perl::Critic::Violation::__ANON__[:265]
0000s0sPerl::Critic::Violation::::__ANON__[:266]Perl::Critic::Violation::__ANON__[:266]
0000s0sPerl::Critic::Violation::::__ANON__[:267]Perl::Critic::Violation::__ANON__[:267]
0000s0sPerl::Critic::Violation::::__ANON__[:268]Perl::Critic::Violation::__ANON__[:268]
0000s0sPerl::Critic::Violation::::__ANON__[:269]Perl::Critic::Violation::__ANON__[:269]
0000s0sPerl::Critic::Violation::::__ANON__[:270]Perl::Critic::Violation::__ANON__[:270]
0000s0sPerl::Critic::Violation::::__ANON__[:271]Perl::Critic::Violation::__ANON__[:271]
0000s0sPerl::Critic::Violation::::__ANON__[:272]Perl::Critic::Violation::__ANON__[:272]
0000s0sPerl::Critic::Violation::::__ANON__[:276]Perl::Critic::Violation::__ANON__[:276]
0000s0sPerl::Critic::Violation::::__ANON__[:277]Perl::Critic::Violation::__ANON__[:277]
0000s0sPerl::Critic::Violation::::_comparePerl::Critic::Violation::_compare
0000s0sPerl::Critic::Violation::::column_numberPerl::Critic::Violation::column_number
0000s0sPerl::Critic::Violation::::descriptionPerl::Critic::Violation::description
0000s0sPerl::Critic::Violation::::diagnosticsPerl::Critic::Violation::diagnostics
0000s0sPerl::Critic::Violation::::element_classPerl::Critic::Violation::element_class
0000s0sPerl::Critic::Violation::::explanationPerl::Critic::Violation::explanation
0000s0sPerl::Critic::Violation::::filenamePerl::Critic::Violation::filename
0000s0sPerl::Critic::Violation::::get_formatPerl::Critic::Violation::get_format
0000s0sPerl::Critic::Violation::::line_numberPerl::Critic::Violation::line_number
0000s0sPerl::Critic::Violation::::logical_filenamePerl::Critic::Violation::logical_filename
0000s0sPerl::Critic::Violation::::logical_line_numberPerl::Critic::Violation::logical_line_number
0000s0sPerl::Critic::Violation::::policyPerl::Critic::Violation::policy
0000s0sPerl::Critic::Violation::::set_formatPerl::Critic::Violation::set_format
0000s0sPerl::Critic::Violation::::severityPerl::Critic::Violation::severity
0000s0sPerl::Critic::Violation::::sort_by_severityPerl::Critic::Violation::sort_by_severity
0000s0sPerl::Critic::Violation::::sourcePerl::Critic::Violation::source
0000s0sPerl::Critic::Violation::::to_stringPerl::Critic::Violation::to_string
0000s0sPerl::Critic::Violation::::visual_column_numberPerl::Critic::Violation::visual_column_number
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::Violation;
9
10238┬Ás115┬Ás
# spent 15┬Ás within Perl::Critic::Violation::BEGIN@10 which was called: # once (15┬Ás+0s) by Perl::Critic::Command::BEGIN@27 at line 10
use 5.006001;
# spent 15┬Ás making 1 call to Perl::Critic::Violation::BEGIN@10
11219┬Ás231┬Ás
# spent 19┬Ás (7+12) within Perl::Critic::Violation::BEGIN@11 which was called: # once (7┬Ás+12┬Ás) by Perl::Critic::Command::BEGIN@27 at line 11
use strict;
# spent 19┬Ás making 1 call to Perl::Critic::Violation::BEGIN@11 # spent 12┬Ás making 1 call to strict::import
12225┬Ás215┬Ás
# spent 11┬Ás (7+4) within Perl::Critic::Violation::BEGIN@12 which was called: # once (7┬Ás+4┬Ás) by Perl::Critic::Command::BEGIN@27 at line 12
use warnings;
# spent 11┬Ás making 1 call to Perl::Critic::Violation::BEGIN@12 # spent 4┬Ás making 1 call to warnings::import
13
14224┬Ás2729┬Ás
# spent 369┬Ás (8+360) within Perl::Critic::Violation::BEGIN@14 which was called: # once (8┬Ás+360┬Ás) by Perl::Critic::Command::BEGIN@27 at line 14
use English qw< -no_match_vars >;
# spent 369┬Ás making 1 call to Perl::Critic::Violation::BEGIN@14 # spent 360┬Ás making 1 call to English::import
15223┬Ás246┬Ás
# spent 27┬Ás (8+19) within Perl::Critic::Violation::BEGIN@15 which was called: # once (8┬Ás+19┬Ás) by Perl::Critic::Command::BEGIN@27 at line 15
use Readonly;
# spent 27┬Ás making 1 call to Perl::Critic::Violation::BEGIN@15 # spent 19┬Ás making 1 call to Exporter::import
16
172125┬Ás21.37ms
# spent 1.34ms (1.17+163┬Ás) within Perl::Critic::Violation::BEGIN@17 which was called: # once (1.17ms+163┬Ás) by Perl::Critic::Command::BEGIN@27 at line 17
use File::Basename qw< basename >;
# spent 1.34ms making 1 call to Perl::Critic::Violation::BEGIN@17 # spent 31┬Ás making 1 call to Exporter::import
18219┬Ás14┬Ás
# spent 4┬Ás within Perl::Critic::Violation::BEGIN@18 which was called: # once (4┬Ás+0s) by Perl::Critic::Command::BEGIN@27 at line 18
use IO::String qw< >;
# spent 4┬Ás making 1 call to Perl::Critic::Violation::BEGIN@18
192100┬Ás12.59ms
# spent 2.59ms (2.47+112┬Ás) within Perl::Critic::Violation::BEGIN@19 which was called: # once (2.47ms+112┬Ás) by Perl::Critic::Command::BEGIN@27 at line 19
use Pod::PlainText qw< >;
# spent 2.59ms making 1 call to Perl::Critic::Violation::BEGIN@19
20224┬Ás256┬Ás
# spent 32┬Ás (9+24) within Perl::Critic::Violation::BEGIN@20 which was called: # once (9┬Ás+24┬Ás) by Perl::Critic::Command::BEGIN@27 at line 20
use Scalar::Util qw< blessed >;
# spent 32┬Ás making 1 call to Perl::Critic::Violation::BEGIN@20 # spent 24┬Ás making 1 call to Exporter::import
21294┬Ás2626┬Ás
# spent 599┬Ás (436+163) within Perl::Critic::Violation::BEGIN@21 which was called: # once (436┬Ás+163┬Ás) by Perl::Critic::Command::BEGIN@27 at line 21
use String::Format qw< stringf >;
# spent 599┬Ás making 1 call to Perl::Critic::Violation::BEGIN@21 # spent 26┬Ás making 1 call to Exporter::import
22
23224┬Ás259┬Ás
# spent 34┬Ás (8+26) within Perl::Critic::Violation::BEGIN@23 which was called: # once (8┬Ás+26┬Ás) by Perl::Critic::Command::BEGIN@27 at line 23
use overload ( q{""} => 'to_string', cmp => '_compare' );
# spent 34┬Ás making 1 call to Perl::Critic::Violation::BEGIN@23 # spent 26┬Ás making 1 call to overload::import
24
25225┬Ás2559┬Ás
# spent 283┬Ás (7+276) within Perl::Critic::Violation::BEGIN@25 which was called: # once (7┬Ás+276┬Ás) by Perl::Critic::Command::BEGIN@27 at line 25
use Perl::Critic::Utils qw< :characters :internal_lookup >;
# spent 283┬Ás making 1 call to Perl::Critic::Violation::BEGIN@25 # spent 276┬Ás making 1 call to Exporter::import
26168┬Ás
# spent 4.75ms (2.41+2.34) within Perl::Critic::Violation::BEGIN@26 which was called: # once (2.41ms+2.34ms) by Perl::Critic::Command::BEGIN@27 at line 29
use Perl::Critic::Utils::POD qw<
27 get_pod_section_for_module
28 trim_pod_section
29147┬Ás24.87ms>;
# spent 4.75ms making 1 call to Perl::Critic::Violation::BEGIN@26 # spent 112┬Ás making 1 call to Exporter::import
3021.66ms2930┬Ás
# spent 871┬Ás (362+509) within Perl::Critic::Violation::BEGIN@30 which was called: # once (362┬Ás+509┬Ás) by Perl::Critic::Command::BEGIN@27 at line 30
use Perl::Critic::Exception::Fatal::Internal qw< throw_internal >;
# spent 871┬Ás making 1 call to Perl::Critic::Violation::BEGIN@30 # spent 59┬Ás making 1 call to Exporter::import
31
321800nsour $VERSION = '1.121';
33
34
3513┬Ás145┬ÁsReadonly::Scalar my $LOCATION_LINE_NUMBER => 0;
# spent 45┬Ás making 1 call to Readonly::Scalar
3611┬Ás130┬ÁsReadonly::Scalar my $LOCATION_COLUMN_NUMBER => 1;
# spent 30┬Ás making 1 call to Readonly::Scalar
3711┬Ás128┬ÁsReadonly::Scalar my $LOCATION_VISUAL_COLUMN_NUMBER => 2;
# spent 28┬Ás making 1 call to Readonly::Scalar
3811┬Ás127┬ÁsReadonly::Scalar my $LOCATION_LOGICAL_LINE_NUMBER => 3;
# spent 27┬Ás making 1 call to Readonly::Scalar
3911┬Ás127┬ÁsReadonly::Scalar my $LOCATION_LOGICAL_FILENAME => 4;
# spent 27┬Ás making 1 call to Readonly::Scalar
40
41
42# Class variables...
431500nsmy $format = "%m at line %l, column %c. %e.\n"; # Default stringy format
441600nsmy %diagnostics = (); # Cache of diagnostic messages
45
46#-----------------------------------------------------------------------------
47
4811┬Ás127┬ÁsReadonly::Scalar my $CONSTRUCTOR_ARG_COUNT => 5;
# spent 27┬Ás making 1 call to Readonly::Scalar
49
50
# spent 817┬Ás (155+663) within Perl::Critic::Violation::new which was called 3 times, avg 272┬Ás/call: # 3 times (155┬Ás+663┬Ás) by Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::violates at line 421 of Perl/Critic/Policy.pm, avg 272┬Ás/call
sub new {
5132┬Ás my ( $class, $desc, $expl, $elem, $sev ) = @_;
52
53 # Check arguments to help out developers who might
54 # be creating new Perl::Critic::Policy modules.
55
5637┬Ás33┬Ás if ( @_ != $CONSTRUCTOR_ARG_COUNT ) {
# spent 3┬Ás making 3 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
57 throw_internal 'Wrong number of args to Violation->new()';
58 }
59
60616┬Ás36┬Ás if ( eval { $elem->isa( 'Perl::Critic::Document' ) } ) {
# spent 6┬Ás making 3 calls to UNIVERSAL::isa, avg 2┬Ás/call
61 # break the facade, return the real PPI::Document
62 $elem = $elem->ppi_document();
63 }
64
65611┬Ás32┬Ás if ( not eval { $elem->isa( 'PPI::Element' ) } ) {
# spent 2┬Ás making 3 calls to UNIVERSAL::isa, avg 600ns/call
66 throw_internal '3rd arg to Violation->new() must be a PPI::Element';
67 }
68
69 # Strip punctuation. These are controlled by the user via the
70 # formats. He/She can use whatever makes sense to them.
7137┬Ás329┬Ás ($desc, $expl) = _chomp_periods($desc, $expl);
# spent 29┬Ás making 3 calls to Perl::Critic::Violation::_chomp_periods, avg 10┬Ás/call
72
73 # Create object
7434┬Ás my $self = bless {}, $class;
75328┬Ás $self->{_description} = $desc;
7632┬Ás $self->{_explanation} = $expl;
7731┬Ás $self->{_severity} = $sev;
7833┬Ás $self->{_policy} = caller;
79
80 # PPI eviscerates the Elements in a Document when the Document gets
81 # DESTROY()ed, and thus they aren't useful after it is gone. So we have
82 # to preemptively grab everything we could possibly want.
83315┬Ás34┬Ás $self->{_element_class} = blessed $elem;
# spent 4┬Ás making 3 calls to Scalar::Util::blessed, avg 2┬Ás/call
84
8538┬Ás3127┬Ás my $top = $elem->top();
# spent 127┬Ás making 3 calls to PPI::Element::top, avg 42┬Ás/call
86319┬Ás69┬Ás $self->{_filename} = $top->can('filename') ? $top->filename() : undef;
# spent 6┬Ás making 3 calls to PPI::Document::File::filename, avg 2┬Ás/call # spent 3┬Ás making 3 calls to UNIVERSAL::can, avg 933ns/call
8736┬Ás3468┬Ás $self->{_source} = _line_containing_violation( $elem );
# spent 468┬Ás making 3 calls to Perl::Critic::Violation::_line_containing_violation, avg 156┬Ás/call
8837┬Ás315┬Ás $self->{_location} =
# spent 15┬Ás making 3 calls to PPI::Element::location, avg 5┬Ás/call
89 $elem->location() || [ 0, 0, 0, 0, $self->filename() ];
90
91312┬Ás return $self;
92}
93
94#-----------------------------------------------------------------------------
95
96sub set_format { return $format = verbosity_to_format( $_[0] ); } ## no critic(ArgUnpacking)
97sub get_format { return $format; }
98
99#-----------------------------------------------------------------------------
100
101
# spent 1.07ms (907┬Ás+160┬Ás) within Perl::Critic::Violation::sort_by_location which was called 144 times, avg 7┬Ás/call: # 144 times (907┬Ás+160┬Ás) by Perl::Critic::_gather_violations at line 148 of Perl/Critic.pm, avg 7┬Ás/call
sub sort_by_location { ## no critic(ArgUnpacking)
102
10314486┬Ás ref $_[0] || shift; # Can call as object or class method
10414452┬Ás return scalar @_ if ! wantarray; # In case we are called in scalar context
105
106 ## TODO: What if $a and $b are not Violation objects?
107 return
108 map {$_->[0]}
109 sort { ($a->[1] <=> $b->[1]) || ($a->[2] <=> $b->[2]) }
110144887┬Ás144160┬Ás map {[$_, $_->location->[0] || 0, $_->location->[1] || 0]}
# spent 160┬Ás making 144 calls to Perl::Critic::Violation::CORE:sort, avg 1┬Ás/call
111 @_;
112}
113
114#-----------------------------------------------------------------------------
115
116sub sort_by_severity { ## no critic(ArgUnpacking)
117
118 ref $_[0] || shift; # Can call as object or class method
119 return scalar @_ if ! wantarray; # In case we are called in scalar context
120
121 ## TODO: What if $a and $b are not Violation objects?
122 return
123 map {$_->[0]}
124 sort { $a->[1] <=> $b->[1] }
125 map {[$_, $_->severity() || 0]}
126 @_;
127}
128
129#-----------------------------------------------------------------------------
130
131
# spent 6┬Ás within Perl::Critic::Violation::location which was called 3 times, avg 2┬Ás/call: # 3 times (6┬Ás+0s) by Perl::Critic::_critique at line 185 of Perl/Critic.pm, avg 2┬Ás/call
sub location {
13231┬Ás my $self = shift;
133
13438┬Ás return $self->{_location};
135}
136
137#-----------------------------------------------------------------------------
138
139sub line_number {
140 my ($self) = @_;
141
142 return $self->location()->[$LOCATION_LINE_NUMBER];
143}
144
145#-----------------------------------------------------------------------------
146
147sub logical_line_number {
148 my ($self) = @_;
149
150 return $self->location()->[$LOCATION_LOGICAL_LINE_NUMBER];
151}
152
153#-----------------------------------------------------------------------------
154
155sub column_number {
156 my ($self) = @_;
157
158 return $self->location()->[$LOCATION_COLUMN_NUMBER];
159}
160
161#-----------------------------------------------------------------------------
162
163sub visual_column_number {
164 my ($self) = @_;
165
166 return $self->location()->[$LOCATION_VISUAL_COLUMN_NUMBER];
167}
168
169#-----------------------------------------------------------------------------
170
171sub diagnostics {
172 my ($self) = @_;
173 my $policy = $self->policy();
174
175 if ( not $diagnostics{$policy} ) {
176 eval { ## no critic (RequireCheckingReturnValueOfEval)
177 my $module_name = ref $policy || $policy;
178 $diagnostics{$policy} =
179 trim_pod_section(
180 get_pod_section_for_module( $module_name, 'DESCRIPTION' )
181 );
182 };
183 $diagnostics{$policy} ||= " No diagnostics available\n";
184 }
185 return $diagnostics{$policy};
186}
187
188#-----------------------------------------------------------------------------
189
190sub description {
191 my $self = shift;
192 return $self->{_description};
193}
194
195#-----------------------------------------------------------------------------
196
197sub explanation {
198 my $self = shift;
199 my $expl = $self->{_explanation};
200 if ( !$expl ) {
201 $expl = '(no explanation)';
202 }
203 if ( ref $expl eq 'ARRAY' ) {
204 my $page = @{$expl} > 1 ? 'pages' : 'page';
205 $page .= $SPACE . join $COMMA, @{$expl};
206 $expl = "See $page of PBP";
207 }
208 return $expl;
209}
210
211#-----------------------------------------------------------------------------
212
213sub severity {
214 my $self = shift;
215 return $self->{_severity};
216}
217
218#-----------------------------------------------------------------------------
219
220sub policy {
221 my $self = shift;
222 return $self->{_policy};
223}
224
225#-----------------------------------------------------------------------------
226
227sub filename {
228 my $self = shift;
229 return $self->{_filename};
230}
231
232#-----------------------------------------------------------------------------
233
234sub logical_filename {
235 my ($self) = @_;
236
237 return $self->location()->[$LOCATION_LOGICAL_FILENAME];
238}
239
240#-----------------------------------------------------------------------------
241
242sub source {
243 my $self = shift;
244 return $self->{_source};
245}
246
247#-----------------------------------------------------------------------------
248
249sub element_class {
250 my ($self) = @_;
251
252 return $self->{_element_class};
253}
254
255#-----------------------------------------------------------------------------
256
257sub to_string {
258 my $self = shift;
259
260 my $long_policy = $self->policy();
261 (my $short_policy = $long_policy) =~ s/ \A Perl::Critic::Policy:: //xms;
262
263 # Wrap the more expensive ones in sub{} to postpone evaluation
264 my %fspec = (
265 'f' => sub { $self->logical_filename() },
266 'F' => sub { basename( $self->logical_filename() ) },
267 'g' => sub { $self->filename() },
268 'G' => sub { basename( $self->filename() ) },
269 'l' => sub { $self->logical_line_number() },
270 'L' => sub { $self->line_number() },
271 'c' => sub { $self->visual_column_number() },
272 'C' => sub { $self->element_class() },
273 'm' => $self->description(),
274 'e' => $self->explanation(),
275 's' => $self->severity(),
276 'd' => sub { $self->diagnostics() },
277 'r' => sub { $self->source() },
278 'P' => $long_policy,
279 'p' => $short_policy,
280 );
281 return stringf($format, %fspec);
282}
283
284#-----------------------------------------------------------------------------
285# Apparently, some perls do not implicitly stringify overloading
286# objects before doing a comparison. This causes a couple of our
287# sorting tests to fail. To work around this, we overload C<cmp> to
288# do it explicitly.
289#
290# 20060503 - More information: This problem has been traced to
291# Test::Simple versions <= 0.60, not perl itself. Upgrading to
292# Test::Simple v0.62 will fix the problem. But rather than forcing
293# everyone to upgrade, I have decided to leave this workaround in
294# place.
295
296sub _compare { return "$_[0]" cmp "$_[1]" }
297
298#-----------------------------------------------------------------------------
299
300
# spent 468┬Ás (77+391) within Perl::Critic::Violation::_line_containing_violation which was called 3 times, avg 156┬Ás/call: # 3 times (77┬Ás+391┬Ás) by Perl::Critic::Violation::new at line 87, avg 156┬Ás/call
sub _line_containing_violation {
3013800ns my ( $elem ) = @_;
302
303312┬Ás665┬Ás my $stmnt = $elem->statement() || $elem;
# spent 64┬Ás making 3 calls to PPI::Element::statement, avg 21┬Ás/call # spent 2┬Ás making 3 calls to PPI::Util::TRUE, avg 500ns/call
30439┬Ás3234┬Ás my $code_string = $stmnt->content() || $EMPTY;
# spent 234┬Ás making 3 calls to PPI::Node::content, avg 78┬Ás/call
305
306 # Split into individual lines
307332┬Ás610┬Ás my @lines = split qr{ \n\s* }xms, $code_string;
# spent 5┬Ás making 3 calls to Perl::Critic::Violation::CORE:qr, avg 2┬Ás/call # spent 4┬Ás making 3 calls to Perl::Critic::Violation::CORE:regcomp, avg 1┬Ás/call
308
309 # Take the line containing the element that is in violation
310314┬Ás683┬Ás my $inx = ( $elem->line_number() || 0 ) -
# spent 83┬Ás making 6 calls to PPI::Element::line_number, avg 14┬Ás/call
311 ( $stmnt->line_number() || 0 );
3123800ns $inx > @lines and return $EMPTY;
31339┬Ás return $lines[$inx];
314}
315
316#-----------------------------------------------------------------------------
317
318
# spent 29┬Ás (27+2) within Perl::Critic::Violation::_chomp_periods which was called 3 times, avg 10┬Ás/call: # 3 times (27┬Ás+2┬Ás) by Perl::Critic::Violation::new at line 71, avg 10┬Ás/call
sub _chomp_periods {
31932┬Ás my @args = @_;
320
32134┬Ás for (@args) {
32263┬Ás next if not defined or ref;
323312┬Ás32┬Ás s{ [.]+ \z }{}xms
# spent 2┬Ás making 3 calls to Perl::Critic::Violation::CORE:subst, avg 800ns/call
324 }
325
32639┬Ás return @args;
327}
328
329#-----------------------------------------------------------------------------
330
33116┬Ás1;
332
333#-----------------------------------------------------------------------------
334
335__END__
 
# spent 5┬Ás within Perl::Critic::Violation::CORE:qr which was called 3 times, avg 2┬Ás/call: # 3 times (5┬Ás+0s) by Perl::Critic::Violation::_line_containing_violation at line 307, avg 2┬Ás/call
sub Perl::Critic::Violation::CORE:qr; # opcode
# spent 4┬Ás within Perl::Critic::Violation::CORE:regcomp which was called 3 times, avg 1┬Ás/call: # 3 times (4┬Ás+0s) by Perl::Critic::Violation::_line_containing_violation at line 307, avg 1┬Ás/call
sub Perl::Critic::Violation::CORE:regcomp; # opcode
# spent 160┬Ás within Perl::Critic::Violation::CORE:sort which was called 144 times, avg 1┬Ás/call: # 144 times (160┬Ás+0s) by Perl::Critic::Violation::sort_by_location at line 110, avg 1┬Ás/call
sub Perl::Critic::Violation::CORE:sort; # opcode
# spent 2┬Ás within Perl::Critic::Violation::CORE:subst which was called 3 times, avg 800ns/call: # 3 times (2┬Ás+0s) by Perl::Critic::Violation::_chomp_periods at line 323, avg 800ns/call
sub Perl::Critic::Violation::CORE:subst; # opcode