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

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Utils.pm
StatementsExecuted 216279 statements in 535ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1431944307ms1.47sPerl::Critic::Utils::::is_hash_keyPerl::Critic::Utils::is_hash_key
1431911154ms657msPerl::Critic::Utils::::_is_followed_by_parensPerl::Critic::Utils::_is_followed_by_parens
1573219.21ms11.3msPerl::Critic::Utils::::CORE:regcompPerl::Critic::Utils::CORE:regcomp (opcode)
1291636.60ms18.1msPerl::Critic::Utils::::policy_short_namePerl::Critic::Utils::policy_short_name
77115.44ms8.42msPerl::Critic::Utils::::is_class_namePerl::Critic::Utils::is_class_name
22267354.41ms4.74msPerl::Critic::Utils::::hashifyPerl::Critic::Utils::hashify
144113.85ms3.99msPerl::Critic::Utils::::_is_backupPerl::Critic::Utils::_is_backup
1112.79ms10.9msPerl::Critic::Utils::::all_perl_filesPerl::Critic::Utils::all_perl_files
79642.32ms48.3msPerl::Critic::Utils::::is_function_callPerl::Critic::Utils::is_function_call
144111.85ms4.02msPerl::Critic::Utils::::shebang_linePerl::Critic::Utils::shebang_line
1300211.68ms1.68msPerl::Critic::Utils::::CORE:substPerl::Critic::Utils::CORE:subst (opcode)
18441.45ms8.72msPerl::Critic::Utils::::parse_arg_listPerl::Critic::Utils::parse_arg_list
282221.36ms3.17msPerl::Critic::Utils::::policy_long_namePerl::Critic::Utils::policy_long_name
154211.23ms1.77msPerl::Critic::Utils::::_name_for_sub_or_stringified_elementPerl::Critic::Utils::_name_for_sub_or_stringified_element
77111.17ms5.20msPerl::Critic::Utils::::is_label_pointerPerl::Critic::Utils::is_label_pointer
77111.07ms4.84msPerl::Critic::Utils::::is_subroutine_namePerl::Critic::Utils::is_subroutine_name
15421908µs1.72msPerl::Critic::Utils::::_is_dereference_operatorPerl::Critic::Utils::_is_dereference_operator
7711905µs2.18msPerl::Critic::Utils::::is_perl_barewordPerl::Critic::Utils::is_perl_bareword
111842µs1.14msPerl::Critic::Utils::::BEGIN@22Perl::Critic::Utils::BEGIN@22
7711832µs5.13msPerl::Critic::Utils::::is_included_module_namePerl::Critic::Utils::is_included_module_name
111807µs1.01msPerl::Critic::Utils::::BEGIN@26Perl::Critic::Utils::BEGIN@26
7711778µs2.34msPerl::Critic::Utils::::is_package_declarationPerl::Critic::Utils::is_package_declaration
7711760µs1.65msPerl::Critic::Utils::::is_perl_filehandlePerl::Critic::Utils::is_perl_filehandle
1811692µs1.80msPerl::Critic::Utils::::split_nodes_on_commaPerl::Critic::Utils::split_nodes_on_comma
7711679µs6.15msPerl::Critic::Utils::::is_method_callPerl::Critic::Utils::is_method_call
116191635µs652µsPerl::Critic::Utils::::CORE:matchPerl::Critic::Utils::CORE:match (opcode)
6632613µs2.86msPerl::Critic::Utils::::first_argPerl::Critic::Utils::first_arg
14411549µs709µsPerl::Critic::Utils::::_is_perlPerl::Critic::Utils::_is_perl
16211529µs529µsPerl::Critic::Utils::::CORE:ftdirPerl::Critic::Utils::CORE:ftdir (opcode)
5564482µs669µsPerl::Critic::Utils::::precedence_ofPerl::Critic::Utils::precedence_of
111346µs48.0msPerl::Critic::Utils::::BEGIN@23Perl::Critic::Utils::BEGIN@23
16211338µs338µsPerl::Critic::Utils::::CORE:ftfilePerl::Critic::Utils::CORE:ftfile (opcode)
111334µs6.76msPerl::Critic::Utils::::BEGIN@25Perl::Critic::Utils::BEGIN@25
111326µs411µsPerl::Critic::Utils::::BEGIN@21Perl::Critic::Utils::BEGIN@21
1811311µs311µsPerl::Critic::Utils::::CORE:readdirPerl::Critic::Utils::CORE:readdir (opcode)
1811160µs160µsPerl::Critic::Utils::::CORE:open_dirPerl::Critic::Utils::CORE:open_dir (opcode)
111102µs106µsPerl::Critic::Utils::::_build_globals_without_sigilsPerl::Critic::Utils::_build_globals_without_sigils
406490µs90µsPerl::Critic::Utils::::words_from_stringPerl::Critic::Utils::words_from_string
192178µs96µsPerl::Critic::Utils::::CORE:sortPerl::Critic::Utils::CORE:sort (opcode)
181156µs56µsPerl::Critic::Utils::::CORE:closedirPerl::Critic::Utils::CORE:closedir (opcode)
11114µs14µsPerl::Critic::Utils::::BEGIN@13Perl::Critic::Utils::BEGIN@13
33113µs18µsPerl::Critic::Utils::::is_integerPerl::Critic::Utils::is_integer
11110µs15µsPerl::Critic::Utils::::BEGIN@15Perl::Critic::Utils::BEGIN@15
1118µs11µsPerl::Critic::Utils::::is_valid_numeric_verbosityPerl::Critic::Utils::is_valid_numeric_verbosity
1117µs12µsPerl::Critic::Utils::::BEGIN@28Perl::Critic::Utils::BEGIN@28
1117µs25µsPerl::Critic::Utils::::BEGIN@16Perl::Critic::Utils::BEGIN@16
1116µs24µsPerl::Critic::Utils::::BEGIN@18Perl::Critic::Utils::BEGIN@18
1116µs356µsPerl::Critic::Utils::::BEGIN@19Perl::Critic::Utils::BEGIN@19
1116µs17µsPerl::Critic::Utils::::BEGIN@14Perl::Critic::Utils::BEGIN@14
1113µs3µsPerl::Critic::Utils::::BEGIN@20Perl::Critic::Utils::BEGIN@20
0000s0sPerl::Critic::Utils::::__ANON__[:1201]Perl::Critic::Utils::__ANON__[:1201]
0000s0sPerl::Critic::Utils::::_is_PL_filePerl::Critic::Utils::_is_PL_file
0000s0sPerl::Critic::Utils::::_is_covered_by_autodiePerl::Critic::Utils::_is_covered_by_autodie
0000s0sPerl::Critic::Utils::::_is_fatalPerl::Critic::Utils::_is_fatal
0000s0sPerl::Critic::Utils::::_normalize_severityPerl::Critic::Utils::_normalize_severity
0000s0sPerl::Critic::Utils::::find_keywordsPerl::Critic::Utils::find_keywords
0000s0sPerl::Critic::Utils::::interpolatePerl::Critic::Utils::interpolate
0000s0sPerl::Critic::Utils::::is_in_void_contextPerl::Critic::Utils::is_in_void_context
0000s0sPerl::Critic::Utils::::is_perl_builtinPerl::Critic::Utils::is_perl_builtin
0000s0sPerl::Critic::Utils::::is_perl_builtin_with_list_contextPerl::Critic::Utils::is_perl_builtin_with_list_context
0000s0sPerl::Critic::Utils::::is_perl_builtin_with_multiple_argumentsPerl::Critic::Utils::is_perl_builtin_with_multiple_arguments
0000s0sPerl::Critic::Utils::::is_perl_builtin_with_no_argumentsPerl::Critic::Utils::is_perl_builtin_with_no_arguments
0000s0sPerl::Critic::Utils::::is_perl_builtin_with_one_argumentPerl::Critic::Utils::is_perl_builtin_with_one_argument
0000s0sPerl::Critic::Utils::::is_perl_builtin_with_optional_argumentPerl::Critic::Utils::is_perl_builtin_with_optional_argument
0000s0sPerl::Critic::Utils::::is_perl_builtin_with_zero_and_or_one_argumentsPerl::Critic::Utils::is_perl_builtin_with_zero_and_or_one_arguments
0000s0sPerl::Critic::Utils::::is_perl_globalPerl::Critic::Utils::is_perl_global
0000s0sPerl::Critic::Utils::::is_qualified_namePerl::Critic::Utils::is_qualified_name
0000s0sPerl::Critic::Utils::::is_scriptPerl::Critic::Utils::is_script
0000s0sPerl::Critic::Utils::::is_unchecked_callPerl::Critic::Utils::is_unchecked_call
0000s0sPerl::Critic::Utils::::severity_to_numberPerl::Critic::Utils::severity_to_number
0000s0sPerl::Critic::Utils::::verbosity_to_formatPerl::Critic::Utils::verbosity_to_format
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
8# NOTE: This module is way too large. Please think about adding new
9# functionality into a P::C::Utils::* module instead.
10
11package Perl::Critic::Utils;
12
13236µs114µs
# spent 14µs within Perl::Critic::Utils::BEGIN@13 which was called: # once (14µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 13
use 5.006001;
# spent 14µs making 1 call to Perl::Critic::Utils::BEGIN@13
14235µs228µs
# spent 17µs (6+11) within Perl::Critic::Utils::BEGIN@14 which was called: # once (6µs+11µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 14
use strict;
# spent 17µs making 1 call to Perl::Critic::Utils::BEGIN@14 # spent 11µs making 1 call to strict::import
15218µs220µs
# spent 15µs (10+5) within Perl::Critic::Utils::BEGIN@15 which was called: # once (10µs+5µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 15
use warnings;
# spent 15µs making 1 call to Perl::Critic::Utils::BEGIN@15 # spent 5µs making 1 call to warnings::import
16220µs244µs
# spent 25µs (7+19) within Perl::Critic::Utils::BEGIN@16 which was called: # once (7µs+19µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 16
use Readonly;
# spent 25µs making 1 call to Perl::Critic::Utils::BEGIN@16 # spent 19µs making 1 call to Exporter::import
17
18219µs243µs
# spent 24µs (6+18) within Perl::Critic::Utils::BEGIN@18 which was called: # once (6µs+18µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 18
use Carp qw( confess );
# spent 24µs making 1 call to Perl::Critic::Utils::BEGIN@18 # spent 18µs making 1 call to Exporter::import
19221µs2705µs
# spent 356µs (6+350) within Perl::Critic::Utils::BEGIN@19 which was called: # once (6µs+350µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 19
use English qw(-no_match_vars);
# spent 356µs making 1 call to Perl::Critic::Utils::BEGIN@19 # spent 350µs making 1 call to English::import
20217µs13µs
# spent 3µs within Perl::Critic::Utils::BEGIN@20 which was called: # once (3µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 20
use File::Spec qw();
# spent 3µs making 1 call to Perl::Critic::Utils::BEGIN@20
21285µs2462µs
# spent 411µs (326+85) within Perl::Critic::Utils::BEGIN@21 which was called: # once (326µs+85µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 21
use Scalar::Util qw( blessed );
# spent 411µs making 1 call to Perl::Critic::Utils::BEGIN@21 # spent 50µs making 1 call to Exporter::import
22285µs11.14ms
# spent 1.14ms (842µs+297µs) within Perl::Critic::Utils::BEGIN@22 which was called: # once (842µs+297µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 22
use B::Keywords qw();
# spent 1.14ms making 1 call to Perl::Critic::Utils::BEGIN@22
232108µs148.0ms
# spent 48.0ms (346µs+47.6) within Perl::Critic::Utils::BEGIN@23 which was called: # once (346µs+47.6ms) by Perl::Critic::Exception::Parse::BEGIN@18 at line 23
use PPI::Token::Quote::Single;
# spent 48.0ms making 1 call to Perl::Critic::Utils::BEGIN@23
24
252183µs26.81ms
# spent 6.76ms (334µs+6.43) within Perl::Critic::Utils::BEGIN@25 which was called: # once (334µs+6.43ms) by Perl::Critic::Exception::Parse::BEGIN@18 at line 25
use Perl::Critic::Exception::Fatal::Generic qw{ throw_generic };
# spent 6.76ms making 1 call to Perl::Critic::Utils::BEGIN@25 # spent 49µs making 1 call to Exporter::import
26283µs21.06ms
# spent 1.01ms (807µs+206µs) within Perl::Critic::Utils::BEGIN@26 which was called: # once (807µs+206µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 26
use Perl::Critic::Utils::PPI qw< is_ppi_expression_or_generic_statement >;
# spent 1.01ms making 1 call to Perl::Critic::Utils::BEGIN@26 # spent 42µs making 1 call to Exporter::import
27
2823.72ms217µs
# spent 12µs (7+5) within Perl::Critic::Utils::BEGIN@28 which was called: # once (7µs+5µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 28
use Exporter 'import';
# spent 12µs making 1 call to Perl::Critic::Utils::BEGIN@28 # spent 5µs making 1 call to Exporter::import
29
301700nsour $VERSION = '1.121';
31
32#-----------------------------------------------------------------------------
33# Exportable symbols here.
34
3514µs175µsReadonly::Array our @EXPORT_OK => qw(
# spent 75µs making 1 call to Readonly::Array
36 $TRUE
37 $FALSE
38
39 $POLICY_NAMESPACE
40
41 $SEVERITY_HIGHEST
42 $SEVERITY_HIGH
43 $SEVERITY_MEDIUM
44 $SEVERITY_LOW
45 $SEVERITY_LOWEST
46 @SEVERITY_NAMES
47
48 $DEFAULT_VERBOSITY
49 $DEFAULT_VERBOSITY_WITH_FILE_NAME
50
51 $COLON
52 $COMMA
53 $DQUOTE
54 $EMPTY
55 $EQUAL
56 $FATCOMMA
57 $PERIOD
58 $PIPE
59 $QUOTE
60 $BACKTICK
61 $SCOLON
62 $SPACE
63 $SLASH
64 $BSLASH
65 $LEFT_PAREN
66 $RIGHT_PAREN
67
68 all_perl_files
69 find_keywords
70 first_arg
71 hashify
72 interpolate
73 is_class_name
74 is_function_call
75 is_hash_key
76 is_in_void_context
77 is_included_module_name
78 is_integer
79 is_label_pointer
80 is_method_call
81 is_package_declaration
82 is_perl_bareword
83 is_perl_builtin
84 is_perl_builtin_with_list_context
85 is_perl_builtin_with_multiple_arguments
86 is_perl_builtin_with_no_arguments
87 is_perl_builtin_with_one_argument
88 is_perl_builtin_with_optional_argument
89 is_perl_builtin_with_zero_and_or_one_arguments
90 is_perl_filehandle
91 is_perl_global
92 is_qualified_name
93 is_script
94 is_subroutine_name
95 is_unchecked_call
96 is_valid_numeric_verbosity
97 parse_arg_list
98 policy_long_name
99 policy_short_name
100 precedence_of
101 severity_to_number
102 shebang_line
103 split_nodes_on_comma
104 verbosity_to_format
105 words_from_string
106);
107
108
109# Note: this is deprecated. This should also violate ProhibitAutomaticExportation,
110# but at the moment, we aren't smart enough to deal with Readonly variables.
1111118µs67157µsReadonly::Array our @EXPORT => @EXPORT_OK;
# spent 88µs making 65 calls to Readonly::Array::FETCH, avg 1µs/call # spent 67µs making 1 call to Readonly::Array # spent 2µs making 1 call to Readonly::Array::FETCHSIZE
112
113
1141144µs67392µsReadonly::Hash our %EXPORT_TAGS => (
# spent 307µs making 1 call to Readonly::Hash # spent 83µs making 65 calls to Readonly::Array::FETCH, avg 1µs/call # spent 1µs making 1 call to Readonly::Array::FETCHSIZE
115 all => [ @EXPORT_OK ],
116 booleans => [ qw{ $TRUE $FALSE } ],
117 severities => [
118 qw{
119 $SEVERITY_HIGHEST
120 $SEVERITY_HIGH
121 $SEVERITY_MEDIUM
122 $SEVERITY_LOW
123 $SEVERITY_LOWEST
124 @SEVERITY_NAMES
125 }
126 ],
127 characters => [
128 qw{
129 $COLON
130 $COMMA
131 $DQUOTE
132 $EMPTY
133 $EQUAL
134 $FATCOMMA
135 $PERIOD
136 $PIPE
137 $QUOTE
138 $BACKTICK
139 $SCOLON
140 $SPACE
141 $SLASH
142 $BSLASH
143 $LEFT_PAREN
144 $RIGHT_PAREN
145 }
146 ],
147 classification => [
148 qw{
149 is_class_name
150 is_function_call
151 is_hash_key
152 is_included_module_name
153 is_integer
154 is_label_pointer
155 is_method_call
156 is_package_declaration
157 is_perl_bareword
158 is_perl_builtin
159 is_perl_filehandle
160 is_perl_global
161 is_perl_builtin_with_list_context
162 is_perl_builtin_with_multiple_arguments
163 is_perl_builtin_with_no_arguments
164 is_perl_builtin_with_one_argument
165 is_perl_builtin_with_optional_argument
166 is_perl_builtin_with_zero_and_or_one_arguments
167 is_qualified_name
168 is_script
169 is_subroutine_name
170 is_unchecked_call
171 is_valid_numeric_verbosity
172 }
173 ],
174 data_conversion => [ qw{ hashify words_from_string interpolate } ],
175 ppi => [ qw{ first_arg parse_arg_list } ],
176 internal_lookup => [ qw{ severity_to_number verbosity_to_format } ],
177 language => [ qw{ precedence_of } ],
178 deprecated => [ qw{ find_keywords } ],
179);
180
181#-----------------------------------------------------------------------------
182
183111µs159µsReadonly::Scalar our $POLICY_NAMESPACE => 'Perl::Critic::Policy';
# spent 59µs making 1 call to Readonly::Scalar
184
185#-----------------------------------------------------------------------------
186
18711µs121µsReadonly::Scalar our $SEVERITY_HIGHEST => 5;
# spent 21µs making 1 call to Readonly::Scalar
18811µs119µsReadonly::Scalar our $SEVERITY_HIGH => 4;
# spent 19µs making 1 call to Readonly::Scalar
1891900ns119µsReadonly::Scalar our $SEVERITY_MEDIUM => 3;
# spent 19µs making 1 call to Readonly::Scalar
1901800ns119µsReadonly::Scalar our $SEVERITY_LOW => 2;
# spent 19µs making 1 call to Readonly::Scalar
1911800ns119µsReadonly::Scalar our $SEVERITY_LOWEST => 1;
# spent 19µs making 1 call to Readonly::Scalar
192
193#-----------------------------------------------------------------------------
194
1951800ns119µsReadonly::Scalar our $COMMA => q{,};
# spent 19µs making 1 call to Readonly::Scalar
1961800ns119µsReadonly::Scalar our $EQUAL => q{=};
# spent 19µs making 1 call to Readonly::Scalar
1971900ns128µsReadonly::Scalar our $FATCOMMA => q{=>};
# spent 28µs making 1 call to Readonly::Scalar
19811µs120µsReadonly::Scalar our $COLON => q{:};
# spent 20µs making 1 call to Readonly::Scalar
1991800ns120µsReadonly::Scalar our $SCOLON => q{;};
# spent 20µs making 1 call to Readonly::Scalar
2001900ns120µsReadonly::Scalar our $QUOTE => q{'};
# spent 20µs making 1 call to Readonly::Scalar
20111µs121µsReadonly::Scalar our $DQUOTE => q{"};
# spent 21µs making 1 call to Readonly::Scalar
2021900ns130µsReadonly::Scalar our $BACKTICK => q{`};
# spent 30µs making 1 call to Readonly::Scalar
2031900ns120µsReadonly::Scalar our $PERIOD => q{.};
# spent 20µs making 1 call to Readonly::Scalar
2041900ns120µsReadonly::Scalar our $PIPE => q{|};
# spent 20µs making 1 call to Readonly::Scalar
2051900ns122µsReadonly::Scalar our $SPACE => q{ };
# spent 22µs making 1 call to Readonly::Scalar
2061900ns120µsReadonly::Scalar our $SLASH => q{/};
# spent 20µs making 1 call to Readonly::Scalar
2071800ns129µsReadonly::Scalar our $BSLASH => q{\\};
# spent 29µs making 1 call to Readonly::Scalar
2081800ns119µsReadonly::Scalar our $LEFT_PAREN => q{(};
# spent 19µs making 1 call to Readonly::Scalar
2091800ns119µsReadonly::Scalar our $RIGHT_PAREN => q{)};
# spent 19µs making 1 call to Readonly::Scalar
2101900ns119µsReadonly::Scalar our $EMPTY => q{};
# spent 19µs making 1 call to Readonly::Scalar
21111µs119µsReadonly::Scalar our $TRUE => 1;
# spent 19µs making 1 call to Readonly::Scalar
2121900ns119µsReadonly::Scalar our $FALSE => 0;
# spent 19µs making 1 call to Readonly::Scalar
213
214#-----------------------------------------------------------------------------
215
216#TODO: Should this include punctuations vars?
217
- -
220#-----------------------------------------------------------------------------
221## no critic (ProhibitNoisyQuotes);
222
22313µs1124µsReadonly::Hash my %PRECEDENCE_OF => (
# spent 124µs making 1 call to Readonly::Hash
224 '->' => 1,
225 '++' => 2,
226 '--' => 2,
227 '**' => 3,
228 '!' => 4,
229 '~' => 4,
230 '\\' => 4,
231 '=~' => 5,
232 '!~' => 5,
233 '*' => 6,
234 '/' => 6,
235 '%' => 6,
236 'x' => 6,
237 '+' => 7,
238 '-' => 7,
239 '.' => 7,
240 '<<' => 8,
241 '>>' => 8,
242 '-R' => 9,
243 '-W' => 9,
244 '-X' => 9,
245 '-r' => 9,
246 '-w' => 9,
247 '-x' => 9,
248 '-e' => 9,
249 '-O' => 9,
250 '-o' => 9,
251 '-z' => 9,
252 '-s' => 9,
253 '-M' => 9,
254 '-A' => 9,
255 '-C' => 9,
256 '-S' => 9,
257 '-c' => 9,
258 '-b' => 9,
259 '-f' => 9,
260 '-d' => 9,
261 '-p' => 9,
262 '-l' => 9,
263 '-u' => 9,
264 '-g' => 9,
265 '-k' => 9,
266 '-t' => 9,
267 '-T' => 9,
268 '-B' => 9,
269 '<' => 10,
270 '>' => 10,
271 '<=' => 10,
272 '>=' => 10,
273 'lt' => 10,
274 'gt' => 10,
275 'le' => 10,
276 'ge' => 10,
277 '==' => 11,
278 '!=' => 11,
279 '<=>' => 11,
280 'eq' => 11,
281 'ne' => 11,
282 'cmp' => 11,
283 '~~' => 11,
284 '&' => 12,
285 '|' => 13,
286 '^' => 13,
287 '&&' => 14,
288 '//' => 15,
289 '||' => 15,
290 '..' => 16,
291 '...' => 17,
292 '?' => 18,
293 ':' => 18,
294 '=' => 19,
295 '+=' => 19,
296 '-=' => 19,
297 '*=' => 19,
298 '/=' => 19,
299 '%=' => 19,
300 '||=' => 19,
301 '&&=' => 19,
302 '|=' => 19,
303 '&=' => 19,
304 '**=' => 19,
305 'x=' => 19,
306 '.=' => 19,
307 '^=' => 19,
308 '<<=' => 19,
309 '>>=' => 19,
310 '//=' => 19,
311 ',' => 20,
312 '=>' => 20,
313 'not' => 22,
314 'and' => 23,
315 'or' => 24,
316 'xor' => 24,
317);
318
319## use critic
320
32113µs234µsReadonly::Scalar my $MIN_PRECEDENCE_TO_TERMINATE_PARENLESS_ARG_LIST =>
# spent 21µs making 1 call to Readonly::Scalar # spent 13µs making 1 call to Perl::Critic::Utils::precedence_of
322 precedence_of( 'not' );
323
324#-----------------------------------------------------------------------------
325
326
# spent 4.74ms (4.41+328µs) within Perl::Critic::Utils::hashify which was called 222 times, avg 21µs/call: # 52 times (59µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 1230, avg 1µs/call # 51 times (190µs+0s) by Perl::Critic::Annotation::_parse_annotation at line 270 of Perl/Critic/Annotation.pm, avg 4µs/call # 32 times (87µs+0s) by Perl::Critic::PolicyParameter::Behavior::StringList::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/StringList.pm:60] at line 55 of Perl/Critic/PolicyParameter/Behavior/StringList.pm, avg 3µs/call # 13 times (62µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 1233, avg 5µs/call # 8 times (26µs+0s) by Perl::Critic::PolicyParameter::Behavior::Enumeration::initialize_parameter at line 48 of Perl/Critic/PolicyParameter/Behavior/Enumeration.pm, avg 3µs/call # 5 times (7µs+0s) by Perl::Critic::PolicyParameter::Behavior::Enumeration::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/Enumeration.pm:93] at line 88 of Perl/Critic/PolicyParameter/Behavior/Enumeration.pm, avg 1µs/call # once (3.10ms+61µs) by Module::Pluggable::Object::_require at line 58 of Perl/Critic/Policy/CodeLayout/ProhibitParensWithBuiltins.pm # once (413µs+196µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 404 # once (57µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 362 # once (35µs+16µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 1085 # once (20µs+9µs) by Module::Pluggable::Object::_require at line 27 of Perl/Critic/Policy/ControlStructures/ProhibitUnreachableCode.pm # once (19µs+9µs) by Module::Pluggable::Object::_require at line 26 of Perl/Critic/Policy/Variables/ProhibitMatchVars.pm # once (18µs+8µs) by Module::Pluggable::Object::_require at line 24 of Perl/Critic/Policy/ControlStructures/ProhibitUnreachableCode.pm # once (16µs+7µs) by Module::Pluggable::Object::_require at line 27 of Perl/Critic/Policy/CodeLayout/ProhibitParensWithBuiltins.pm # once (22µs+0s) by Perl::Critic::PolicyFactory::_validate_policies_in_profile at line 305 of Perl/Critic/PolicyFactory.pm # once (21µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 655 # once (20µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 477 # once (14µs+5µs) by Module::Pluggable::Object::_require at line 21 of Perl/Critic/Policy/ControlStructures/ProhibitUnreachableCode.pm # once (12µs+4µs) by Module::Pluggable::Object::_require at line 23 of Perl/Critic/Policy/InputOutput/RequireBracedFileHandleWithPrint.pm # once (12µs+4µs) by Perl::Critic::Command::BEGIN@26 at line 66 of Perl/Critic/Utils/Constants.pm # once (11µs+4µs) by Module::Pluggable::Object::_require at line 25 of Perl/Critic/Policy/Subroutines/ProhibitBuiltinHomonyms.pm # once (11µs+2µs) by Module::Pluggable::Object::_require at line 88 of Perl/Critic/Policy/NamingConventions/Capitalization.pm # once (10µs+3µs) by Module::Pluggable::Object::_require at line 32 of Perl/Critic/Policy/Subroutines/ProhibitUnusedPrivateSubroutines.pm # once (12µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 373 # once (8µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 598 # once (7µs+0s) by Module::Pluggable::Object::_require at line 44 of Perl/Critic/Policy/ValuesAndExpressions/RequireConstantVersion.pm # once (7µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 429 # once (7µs+0s) by Module::Pluggable::Object::_require at line 242 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm # once (6µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 557 # once (6µs+0s) by Module::Pluggable::Object::_require at line 35 of Perl/Critic/Policy/Variables/ProhibitAugmentedAssignmentInDeclaration.pm # once (6µs+0s) by Module::Pluggable::Object::_require at line 21 of Perl/Critic/Policy/ControlStructures/ProhibitLabelsWithSpecialBlockNames.pm # once (6µs+0s) by Module::Pluggable::Object::_require at line 28 of Perl/Critic/Policy/RegularExpressions/ProhibitEscapedMetacharacters.pm # once (5µs+0s) by Module::Pluggable::Object::_require at line 105 of Perl/Critic/Policy/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 298 of Perl/Critic/Policy/ErrorHandling/RequireCarping.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 22 of Perl/Critic/Policy/RegularExpressions/ProhibitCaptureWithoutTest.pm # once (4µs+0s) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::initialize_if_enabled at line 88 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm # once (4µs+0s) by Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity::BEGIN@16 at line 31 of Perl/Critic/Utils/McCabe.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 198 of Perl/Critic/Policy/Subroutines/RequireArgUnpacking.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 221 of Perl/Critic/Policy/Subroutines/RequireArgUnpacking.pm # once (4µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 416 # once (4µs+0s) by Module::Pluggable::Object::_require at line 24 of Perl/Critic/Policy/ValuesAndExpressions/ProhibitMixedBooleanOperators.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 25 of Perl/Critic/Policy/BuiltinFunctions/ProhibitBooleanGrep.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 45 of Perl/Critic/Policy/Variables/ProhibitConditionalDeclarations.pm # once (4µs+0s) by Module::Pluggable::Object::_require at line 26 of Perl/Critic/Policy/Subroutines/ProhibitAmpersandSigils.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 27 of Perl/Critic/Policy/ValuesAndExpressions/ProhibitMixedBooleanOperators.pm # once (3µs+0s) by Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity::BEGIN@16 at line 34 of Perl/Critic/Utils/McCabe.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 32 of Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 33 of Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 23 of Perl/Critic/Policy/Variables/RequireLocalizedPunctuationVars.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 25 of Perl/Critic/Policy/Subroutines/RequireFinalReturn.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 26 of Perl/Critic/Policy/BuiltinFunctions/ProhibitBooleanGrep.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 35 of Perl/Critic/Policy/InputOutput/RequireBriefOpen.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 33 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 31 of Perl/Critic/Policy/Variables/ProhibitEvilVariables.pm # once (3µs+0s) by Module::Pluggable::Object::_require at line 23 of Perl/Critic/Policy/RegularExpressions/ProhibitCaptureWithoutTest.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 34 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 25 of Perl/Critic/Policy/ValuesAndExpressions/ProhibitMixedBooleanOperators.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 499 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm # once (2µs+0s) by Perl::Critic::Config::_validate_and_save_program_extensions at line 768 of Perl/Critic/Config.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 41 of Perl/Critic/Policy/InputOutput/RequireBriefOpen.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 29 of Perl/Critic/Policy/Subroutines/ProhibitAmpersandSigils.pm # once (2µs+0s) by Perl::Critic::Config::program_extensions_as_regexes at line 952 of Perl/Critic/Config.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 247 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm # once (2µs+0s) by Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers::_determine_allowed_values at line 184 of Perl/Critic/Policy/ValuesAndExpressions/ProhibitMagicNumbers.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 224 of Perl/Critic/Policy/Subroutines/RequireArgUnpacking.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 201 of Perl/Critic/Policy/Subroutines/RequireArgUnpacking.pm # once (2µs+0s) by Module::Pluggable::Object::_require at line 250 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
sub hashify { ## no critic (ArgUnpacking)
3272221.47ms256328µs return map { $_ => 1 } @_;
# spent 319µs making 249 calls to Readonly::Array::FETCH, avg 1µs/call # spent 9µs making 7 calls to Readonly::Scalar::FETCH, avg 1µs/call
328}
329
330#-----------------------------------------------------------------------------
331
332sub interpolate {
333 my ( $literal ) = @_;
334 return eval "\"$literal\"" || confess $EVAL_ERROR; ## no critic (StringyEval);
335}
336
337#-----------------------------------------------------------------------------
338
339sub find_keywords {
340 my ( $doc, $keyword ) = @_;
341 my $nodes_ref = $doc->find('PPI::Token::Word');
342 return if !$nodes_ref;
343 my @matches = grep { $_ eq $keyword } @{$nodes_ref};
344 return @matches ? \@matches : undef;
345}
346
347#-----------------------------------------------------------------------------
348
349
# spent 1.77ms (1.23+541µs) within Perl::Critic::Utils::_name_for_sub_or_stringified_element which was called 154 times, avg 12µs/call: # 77 times (724µs+313µs) by Perl::Critic::Utils::is_perl_bareword at line 379, avg 13µs/call # 77 times (508µs+228µs) by Perl::Critic::Utils::is_perl_filehandle at line 422, avg 10µs/call
sub _name_for_sub_or_stringified_element {
35015431µs my $elem = shift;
351
352154946µs308329µs if ( blessed $elem and $elem->isa('PPI::Statement::Sub') ) {
# spent 167µs making 154 calls to UNIVERSAL::isa, avg 1µs/call # spent 162µs making 154 calls to Scalar::Util::blessed, avg 1µs/call
353 return $elem->name();
354 }
355
356154486µs154212µs return "$elem";
# spent 212µs making 154 calls to PPI::Token::content, avg 1µs/call
357}
358
359#-----------------------------------------------------------------------------
360## no critic (ProhibitPackageVars)
361
362130µs2336µsReadonly::Hash my %BUILTINS => hashify( @B::Keywords::Functions );
# spent 279µs making 1 call to Readonly::Hash # spent 57µs making 1 call to Perl::Critic::Utils::hashify
363
364sub is_perl_builtin {
365 my $elem = shift;
366 return if !$elem;
367
368 return exists $BUILTINS{ _name_for_sub_or_stringified_element($elem) };
369}
370
371#-----------------------------------------------------------------------------
372
37317µs287µsReadonly::Hash my %BAREWORDS => hashify( @B::Keywords::Barewords );
# spent 74µs making 1 call to Readonly::Hash # spent 12µs making 1 call to Perl::Critic::Utils::hashify
374
375
# spent 2.18ms (905µs+1.27) within Perl::Critic::Utils::is_perl_bareword which was called 77 times, avg 28µs/call: # 77 times (905µs+1.27ms) by Perl::Critic::Utils::is_function_call at line 838, avg 28µs/call
sub is_perl_bareword {
3767725µs my $elem = shift;
37777197µs7736µs return if !$elem;
# spent 36µs making 77 calls to PPI::Util::TRUE, avg 468ns/call
378
37977604µs1541.24ms return exists $BAREWORDS{ _name_for_sub_or_stringified_element($elem) };
# spent 1.04ms making 77 calls to Perl::Critic::Utils::_name_for_sub_or_stringified_element, avg 13µs/call # spent 200µs making 77 calls to Readonly::Hash::EXISTS, avg 3µs/call
380}
381
382#-----------------------------------------------------------------------------
383
384
# spent 106µs (102+4) within Perl::Critic::Utils::_build_globals_without_sigils which was called: # once (102µs+4µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 402
sub _build_globals_without_sigils {
385 # B::Keywords as of 1.08 forgot $\
386 my @globals =
387147µs map { substr $_, 1 }
388 @B::Keywords::Arrays,
389 @B::Keywords::Hashes,
390 @B::Keywords::Scalars,
391 '$\\'; ## no critic (RequireInterpolationOfMetachars)
392
393 # Not all of these have sigils
3941700ns foreach my $filehandle (@B::Keywords::Filehandles) {
395920µs94µs (my $stripped = $filehandle) =~ s< \A [*] ><>xms;
# spent 4µs making 9 calls to Perl::Critic::Utils::CORE:subst, avg 444ns/call
39695µs push @globals, $stripped;
397 }
398
399134µs return @globals;
400}
401
402115µs2222µsReadonly::Array my @GLOBALS_WITHOUT_SIGILS => _build_globals_without_sigils();
# spent 115µs making 1 call to Readonly::Array # spent 106µs making 1 call to Perl::Critic::Utils::_build_globals_without_sigils
403
404168µs3799µsReadonly::Hash my %GLOBALS => hashify( @GLOBALS_WITHOUT_SIGILS );
# spent 609µs making 1 call to Perl::Critic::Utils::hashify # spent 188µs making 1 call to Readonly::Hash # spent 1µs making 1 call to Readonly::Array::FETCHSIZE
405
406sub is_perl_global {
407 my $elem = shift;
408 return if !$elem;
409 my $var_name = "$elem"; #Convert Token::Symbol to string
410 $var_name =~ s{\A [\$@%*] }{}xms; #Chop off the sigil
411 return exists $GLOBALS{ $var_name };
412}
413
414#-----------------------------------------------------------------------------
415
41613µs236µsReadonly::Hash my %FILEHANDLES => hashify( @B::Keywords::Filehandles );
# spent 32µs making 1 call to Readonly::Hash # spent 4µs making 1 call to Perl::Critic::Utils::hashify
417
418
# spent 1.65ms (760µs+890µs) within Perl::Critic::Utils::is_perl_filehandle which was called 77 times, avg 21µs/call: # 77 times (760µs+890µs) by Perl::Critic::Utils::is_function_call at line 839, avg 21µs/call
sub is_perl_filehandle {
4197726µs my $elem = shift;
42077211µs7735µs return if !$elem;
# spent 35µs making 77 calls to PPI::Util::TRUE, avg 460ns/call
421
42277413µs154855µs return exists $FILEHANDLES{ _name_for_sub_or_stringified_element($elem) };
# spent 736µs making 77 calls to Perl::Critic::Utils::_name_for_sub_or_stringified_element, avg 10µs/call # spent 119µs making 77 calls to Readonly::Hash::EXISTS, avg 2µs/call
423}
424
425## use critic
426#-----------------------------------------------------------------------------
427
428# egrep '=item.*LIST' perlfunc.pod
42915µs252µsReadonly::Hash my %BUILTINS_WHICH_PROVIDE_LIST_CONTEXT =>
# spent 45µs making 1 call to Readonly::Hash # spent 7µs making 1 call to Perl::Critic::Utils::hashify
430 hashify(
431 qw{
432 chmod
433 chown
434 die
435 exec
436 formline
437 grep
438 import
439 join
440 kill
441 map
442 no
443 open
444 pack
445 print
446 printf
447 push
448 reverse
449 say
450 sort
451 splice
452 sprintf
453 syscall
454 system
455 tie
456 unlink
457 unshift
458 use
459 utime
460 warn
461 },
462 );
463
464sub is_perl_builtin_with_list_context {
465 my $elem = shift;
466
467 return
468 exists
469 $BUILTINS_WHICH_PROVIDE_LIST_CONTEXT{
470 _name_for_sub_or_stringified_element($elem)
471 };
472}
473
474#-----------------------------------------------------------------------------
475
476# egrep '=item.*[A-Z],' perlfunc.pod
477162µs32154µsReadonly::Hash my %BUILTINS_WHICH_TAKE_MULTIPLE_ARGUMENTS =>
# spent 101µs making 1 call to Readonly::Hash # spent 30µs making 29 calls to Readonly::Hash::NEXTKEY, avg 1µs/call # spent 20µs making 1 call to Perl::Critic::Utils::hashify # spent 4µs making 1 call to Readonly::Hash::FIRSTKEY
478 hashify(
479 qw{
480 accept
481 atan2
482 bind
483 binmode
484 bless
485 connect
486 crypt
487 dbmopen
488 fcntl
489 flock
490 gethostbyaddr
491 getnetbyaddr
492 getpriority
493 getservbyname
494 getservbyport
495 getsockopt
496 index
497 ioctl
498 link
499 listen
500 mkdir
501 msgctl
502 msgget
503 msgrcv
504 msgsnd
505 open
506 opendir
507 pipe
508 read
509 recv
510 rename
511 rindex
512 seek
513 seekdir
514 select
515 semctl
516 semget
517 semop
518 send
519 setpgrp
520 setpriority
521 setsockopt
522 shmctl
523 shmget
524 shmread
525 shmwrite
526 shutdown
527 socket
528 socketpair
529 splice
530 split
531 substr
532 symlink
533 sysopen
534 sysread
535 sysseek
536 syswrite
537 truncate
538 unpack
539 vec
540 waitpid
541 },
542 keys %BUILTINS_WHICH_PROVIDE_LIST_CONTEXT
543 );
544
545sub is_perl_builtin_with_multiple_arguments {
546 my $elem = shift;
547
548 return
549 exists
550 $BUILTINS_WHICH_TAKE_MULTIPLE_ARGUMENTS{
551 _name_for_sub_or_stringified_element($elem)
552 };
553}
554
555#-----------------------------------------------------------------------------
556
55714µs246µsReadonly::Hash my %BUILTINS_WHICH_TAKE_NO_ARGUMENTS =>
# spent 40µs making 1 call to Readonly::Hash # spent 6µs making 1 call to Perl::Critic::Utils::hashify
558 hashify(
559 qw{
560 endgrent
561 endhostent
562 endnetent
563 endprotoent
564 endpwent
565 endservent
566 fork
567 format
568 getgrent
569 gethostent
570 getlogin
571 getnetent
572 getppid
573 getprotoent
574 getpwent
575 getservent
576 setgrent
577 setpwent
578 split
579 time
580 times
581 wait
582 wantarray
583 }
584 );
585
586sub is_perl_builtin_with_no_arguments {
587 my $elem = shift;
588
589 return
590 exists
591 $BUILTINS_WHICH_TAKE_NO_ARGUMENTS{
592 _name_for_sub_or_stringified_element($elem)
593 };
594}
595
596#-----------------------------------------------------------------------------
597
59815µs261µsReadonly::Hash my %BUILTINS_WHICH_TAKE_ONE_ARGUMENT =>
# spent 53µs making 1 call to Readonly::Hash # spent 8µs making 1 call to Perl::Critic::Utils::hashify
599 hashify(
600 qw{
601 closedir
602 dbmclose
603 delete
604 each
605 exists
606 fileno
607 getgrgid
608 getgrnam
609 gethostbyname
610 getnetbyname
611 getpeername
612 getpgrp
613 getprotobyname
614 getprotobynumber
615 getpwnam
616 getpwuid
617 getsockname
618 goto
619 keys
620 local
621 prototype
622 readdir
623 readline
624 readpipe
625 rewinddir
626 scalar
627 sethostent
628 setnetent
629 setprotoent
630 setservent
631 telldir
632 tied
633 untie
634 values
635 }
636 );
637
638sub is_perl_builtin_with_one_argument {
639 my $elem = shift;
640
641 return
642 exists
643 $BUILTINS_WHICH_TAKE_ONE_ARGUMENT{
644 _name_for_sub_or_stringified_element($elem)
645 };
646}
647
648#-----------------------------------------------------------------------------
649
650## no critic (ProhibitPackageVars)
651Readonly::Hash my %BUILTINS_WHICH_TAKE_OPTIONAL_ARGUMENT =>
652 hashify(
653 grep { not exists $BUILTINS_WHICH_TAKE_ONE_ARGUMENT{ $_ } }
654 grep { not exists $BUILTINS_WHICH_TAKE_NO_ARGUMENTS{ $_ } }
65511.18ms529918µs grep { not exists $BUILTINS_WHICH_TAKE_MULTIPLE_ARGUMENTS{ $_ } }
# spent 773µs making 527 calls to Readonly::Hash::EXISTS, avg 1µs/call # spent 124µs making 1 call to Readonly::Hash # spent 21µs making 1 call to Perl::Critic::Utils::hashify
656 @B::Keywords::Functions
657 );
658## use critic
659
660sub is_perl_builtin_with_optional_argument {
661 my $elem = shift;
662
663 return
664 exists
665 $BUILTINS_WHICH_TAKE_OPTIONAL_ARGUMENT{
666 _name_for_sub_or_stringified_element($elem)
667 };
668}
669
670#-----------------------------------------------------------------------------
671
672sub is_perl_builtin_with_zero_and_or_one_arguments {
673 my $elem = shift;
674
675 return if not $elem;
676
677 my $name = _name_for_sub_or_stringified_element($elem);
678
679 return (
680 exists $BUILTINS_WHICH_TAKE_ONE_ARGUMENT{ $name }
681 or exists $BUILTINS_WHICH_TAKE_NO_ARGUMENTS{ $name }
682 or exists $BUILTINS_WHICH_TAKE_OPTIONAL_ARGUMENT{ $name }
683 );
684}
685
686#-----------------------------------------------------------------------------
687
688sub is_qualified_name {
689 my $name = shift;
690
691 return if not $name;
692
693 return index ( $name, q{::} ) >= 0;
694}
695
696#-----------------------------------------------------------------------------
697
698
# spent 669µs (482+187) within Perl::Critic::Utils::precedence_of which was called 55 times, avg 12µs/call: # 50 times (448µs+175µs) by Perl::Critic::Utils::parse_arg_list at line 972, avg 12µs/call # once (8µs+6µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 321 # once (7µs+2µs) by Module::Pluggable::Object::_require at line 36 of Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm # once (7µs+2µs) by Module::Pluggable::Object::_require at line 32 of Perl/Critic/Policy/CodeLayout/ProhibitParensWithBuiltins.pm # once (7µs+2µs) by Module::Pluggable::Object::_require at line 26 of Perl/Critic/Policy/BuiltinFunctions/ProhibitLvalueSubstr.pm # once (5µs+2µs) by Module::Pluggable::Object::_require at line 33 of Perl/Critic/Policy/CodeLayout/ProhibitParensWithBuiltins.pm
sub precedence_of {
6995515µs my $elem = shift;
70055113µs5023µs return if !$elem;
# spent 23µs making 50 calls to PPI::Util::TRUE, avg 464ns/call
70155300µs105164µs return $PRECEDENCE_OF{ ref $elem ? "$elem" : $elem };
# spent 94µs making 55 calls to Readonly::Hash::FETCH, avg 2µs/call # spent 70µs making 50 calls to PPI::Token::content, avg 1µs/call
702}
703
704#-----------------------------------------------------------------------------
705
706
# spent 1.47s (307ms+1.16) within Perl::Critic::Utils::is_hash_key which was called 14319 times, avg 103µs/call: # 10038 times (201ms+818ms) by Perl::Critic::Utils::McCabe::_count_logic_keywords at line 112 of Perl/Critic/Utils/McCabe.pm, avg 102µs/call # 2101 times (50.9ms+173ms) by Perl::Critic::Policy::Subroutines::ProhibitReturnSort::violates at line 37 of Perl/Critic/Policy/Subroutines/ProhibitReturnSort.pm, avg 106µs/call # 2101 times (53.2ms+164ms) by Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::violates at line 37 of Perl/Critic/Policy/Subroutines/ProhibitExplicitReturnUndef.pm, avg 104µs/call # 79 times (1.94ms+8.07ms) by Perl::Critic::Utils::is_function_call at line 832, avg 127µs/call
sub is_hash_key {
707143193.01ms my $elem = shift;
7081431941.1ms143197.56ms return if !$elem;
# spent 7.56ms making 14319 calls to PPI::Util::TRUE, avg 528ns/call
709
710 #If followed by an argument list, then its a function call, not a literal
7111431921.9ms14319657ms return if _is_followed_by_parens($elem);
# spent 657ms making 14319 calls to Perl::Critic::Utils::_is_followed_by_parens, avg 46µs/call
712
713 #Check curly-brace style: $hash{foo} = bar;
7141158412.7ms1158447.4ms my $parent = $elem->parent();
# spent 47.4ms making 11584 calls to PPI::Element::parent, avg 4µs/call
7151158440.4ms115846.81ms return if !$parent;
# spent 6.81ms making 11584 calls to PPI::Util::TRUE, avg 588ns/call
7161158411.7ms1158448.9ms my $grandparent = $parent->parent();
# spent 48.9ms making 11584 calls to PPI::Element::parent, avg 4µs/call
7171158427.1ms115846.48ms return if !$grandparent;
# spent 6.48ms making 11584 calls to PPI::Util::TRUE, avg 559ns/call
7181158444.0ms1158413.5ms return 1 if $grandparent->isa('PPI::Structure::Subscript');
# spent 12.3ms making 11331 calls to UNIVERSAL::isa, avg 1µs/call # spent 1.15ms making 249 calls to PPI::Structure::List::isa, avg 5µs/call # spent 16µs making 4 calls to PPI::Structure::For::isa, avg 4µs/call
719
720
721 #Check declarative style: %hash = (foo => bar);
7221139911.3ms11399338ms my $sib = $elem->snext_sibling();
# spent 338ms making 11399 calls to PPI::Element::snext_sibling, avg 30µs/call
7231139933.2ms112606.65ms return if !$sib;
# spent 6.65ms making 11260 calls to PPI::Util::TRUE, avg 591ns/call
7241126036.6ms1216431.1ms return 1 if $sib->isa('PPI::Token::Operator') && $sib eq '=>';
# spent 18.8ms making 904 calls to PPI::Element::__eq, avg 21µs/call # spent 12.3ms making 11257 calls to UNIVERSAL::isa, avg 1µs/call # spent 12µs making 3 calls to PPI::Structure::For::isa, avg 4µs/call
725
7261075829.3ms return;
727}
728
729#-----------------------------------------------------------------------------
730
731
# spent 657ms (154+503) within Perl::Critic::Utils::_is_followed_by_parens which was called 14319 times, avg 46µs/call: # 14319 times (154ms+503ms) by Perl::Critic::Utils::is_hash_key at line 711, avg 46µs/call
sub _is_followed_by_parens {
732143191.87ms my $elem = shift;
7331431942.3ms143195.71ms return if !$elem;
# spent 5.71ms making 14319 calls to PPI::Util::TRUE, avg 399ns/call
734
7351431958.0ms28319469ms my $sibling = $elem->snext_sibling() || return;
# spent 461ms making 14319 calls to PPI::Element::snext_sibling, avg 32µs/call # spent 8.12ms making 14000 calls to PPI::Util::TRUE, avg 580ns/call
7361400070.8ms1400029.0ms return $sibling->isa('PPI::Structure::List');
# spent 14.8ms making 11262 calls to UNIVERSAL::isa, avg 1µs/call # spent 14.2ms making 2735 calls to PPI::Structure::List::isa, avg 5µs/call # spent 14µs making 3 calls to PPI::Structure::For::isa, avg 5µs/call
737}
738
739#-----------------------------------------------------------------------------
740
741
# spent 5.13ms (832µs+4.30) within Perl::Critic::Utils::is_included_module_name which was called 77 times, avg 67µs/call: # 77 times (832µs+4.30ms) by Perl::Critic::Utils::is_function_call at line 836, avg 67µs/call
sub is_included_module_name {
7427723µs my $elem = shift;
74377201µs7734µs return if !$elem;
# spent 34µs making 77 calls to PPI::Util::TRUE, avg 442ns/call
74477108µs774.12ms my $stmnt = $elem->statement();
# spent 4.12ms making 77 calls to PPI::Element::statement, avg 54µs/call
74577196µs7739µs return if !$stmnt;
# spent 39µs making 77 calls to PPI::Util::TRUE, avg 509ns/call
74677425µs77106µs return if !$stmnt->isa('PPI::Statement::Include');
# spent 106µs making 77 calls to UNIVERSAL::isa, avg 1µs/call
747 return $stmnt->schild(1) == $elem;
748}
749
750#-----------------------------------------------------------------------------
751
752
# spent 18µs (13+5) within Perl::Critic::Utils::is_integer which was called 3 times, avg 6µs/call: # once (7µs+3µs) by Perl::Critic::Config::_validate_and_save_verbosity at line 487 of Perl/Critic/Config.pm # once (3µs+1µs) by Perl::Critic::Config::_validate_and_save_severity at line 529 of Perl/Critic/Config.pm # once (3µs+1µs) by Perl::Critic::Config::_validate_and_save_top at line 588 of Perl/Critic/Config.pm
sub is_integer {
7533500ns my ($value) = @_;
7543600ns return 0 if not defined $value;
755
756320µs35µs return $value =~ m{ \A [+-]? \d+ \z }xms;
# spent 5µs making 3 calls to Perl::Critic::Utils::CORE:match, avg 2µs/call
757}
758
759#-----------------------------------------------------------------------------
760
761
# spent 5.20ms (1.17+4.03) within Perl::Critic::Utils::is_label_pointer which was called 77 times, avg 67µs/call: # 77 times (1.17ms+4.03ms) by Perl::Critic::Utils::is_function_call at line 840, avg 67µs/call
sub is_label_pointer {
7627726µs my $elem = shift;
76377196µs7734µs return if !$elem;
# spent 34µs making 77 calls to PPI::Util::TRUE, avg 445ns/call
764
76577106µs771.43ms my $statement = $elem->statement();
# spent 1.43ms making 77 calls to PPI::Element::statement, avg 19µs/call
76677200µs7740µs return if !$statement;
# spent 40µs making 77 calls to PPI::Util::TRUE, avg 514ns/call
767
76877116µs772.35ms my $psib = $elem->sprevious_sibling();
# spent 2.35ms making 77 calls to PPI::Element::sprevious_sibling, avg 31µs/call
76977202µs5232µs return if !$psib;
# spent 32µs making 52 calls to PPI::Util::TRUE, avg 625ns/call
770
77152377µs76158µs return $statement->isa('PPI::Statement::Break')
# spent 78µs making 52 calls to UNIVERSAL::isa, avg 1µs/call # spent 62µs making 12 calls to Perl::Critic::Utils::CORE:match, avg 5µs/call # spent 17µs making 12 calls to PPI::Token::content, avg 1µs/call
772 && $psib =~ m/(?:redo|goto|next|last)/xmso;
773}
774
775#-----------------------------------------------------------------------------
776
777
# spent 6.15ms (679µs+5.47) within Perl::Critic::Utils::is_method_call which was called 77 times, avg 80µs/call: # 77 times (679µs+5.47ms) by Perl::Critic::Utils::is_function_call at line 833, avg 80µs/call
sub is_method_call {
7787725µs my $elem = shift;
77977207µs7738µs return if !$elem;
# spent 38µs making 77 calls to PPI::Util::TRUE, avg 491ns/call
780
78177377µs1545.43ms return _is_dereference_operator( $elem->sprevious_sibling() );
# spent 4.27ms making 77 calls to PPI::Element::sprevious_sibling, avg 56µs/call # spent 1.16ms making 77 calls to Perl::Critic::Utils::_is_dereference_operator, avg 15µs/call
782}
783
784#-----------------------------------------------------------------------------
785
786
# spent 8.42ms (5.44+2.98) within Perl::Critic::Utils::is_class_name which was called 77 times, avg 109µs/call: # 77 times (5.44ms+2.98ms) by Perl::Critic::Utils::is_function_call at line 834, avg 109µs/call
sub is_class_name {
7877725µs my $elem = shift;
78877200µs7740µs return if !$elem;
# spent 40µs making 77 calls to PPI::Util::TRUE, avg 517ns/call
789
79077337µs1542.94ms return _is_dereference_operator( $elem->snext_sibling() )
# spent 2.38ms making 77 calls to PPI::Element::snext_sibling, avg 31µs/call # spent 560µs making 77 calls to Perl::Critic::Utils::_is_dereference_operator, avg 7µs/call
791 && !_is_dereference_operator( $elem->sprevious_sibling() );
792}
793
794#-----------------------------------------------------------------------------
795
796
# spent 1.72ms (908µs+812µs) within Perl::Critic::Utils::_is_dereference_operator which was called 154 times, avg 11µs/call: # 77 times (468µs+692µs) by Perl::Critic::Utils::is_method_call at line 781, avg 15µs/call # 77 times (439µs+120µs) by Perl::Critic::Utils::is_class_name at line 790, avg 7µs/call
sub _is_dereference_operator {
79715447µs my $elem = shift;
798154382µs12860µs return if !$elem;
# spent 60µs making 128 calls to PPI::Util::TRUE, avg 471ns/call
799
800128719µs168752µs return $elem->isa('PPI::Token::Operator') && $elem eq q{->};
# spent 617µs making 40 calls to PPI::Element::__eq, avg 15µs/call # spent 135µs making 128 calls to UNIVERSAL::isa, avg 1µs/call
801}
802
803#-----------------------------------------------------------------------------
804
805
# spent 2.34ms (778µs+1.56) within Perl::Critic::Utils::is_package_declaration which was called 77 times, avg 30µs/call: # 77 times (778µs+1.56ms) by Perl::Critic::Utils::is_function_call at line 837, avg 30µs/call
sub is_package_declaration {
8067725µs my $elem = shift;
80777184µs7735µs return if !$elem;
# spent 35µs making 77 calls to PPI::Util::TRUE, avg 458ns/call
8087797µs771.39ms my $stmnt = $elem->statement();
# spent 1.39ms making 77 calls to PPI::Element::statement, avg 18µs/call
80977192µs7739µs return if !$stmnt;
# spent 39µs making 77 calls to PPI::Util::TRUE, avg 509ns/call
81077416µs7797µs return if !$stmnt->isa('PPI::Statement::Package');
# spent 97µs making 77 calls to UNIVERSAL::isa, avg 1µs/call
811 return $stmnt->schild(1) == $elem;
812}
813
814#-----------------------------------------------------------------------------
815
816
# spent 4.84ms (1.07+3.77) within Perl::Critic::Utils::is_subroutine_name which was called 77 times, avg 63µs/call: # 77 times (1.07ms+3.77ms) by Perl::Critic::Utils::is_function_call at line 835, avg 63µs/call
sub is_subroutine_name {
8177725µs my $elem = shift;
81877216µs7735µs return if !$elem;
# spent 35µs making 77 calls to PPI::Util::TRUE, avg 455ns/call
81977113µs772.41ms my $sib = $elem->sprevious_sibling();
# spent 2.41ms making 77 calls to PPI::Element::sprevious_sibling, avg 31µs/call
82077209µs5234µs return if !$sib;
# spent 34µs making 52 calls to PPI::Util::TRUE, avg 646ns/call
8215294µs521.19ms my $stmnt = $elem->statement();
# spent 1.19ms making 52 calls to PPI::Element::statement, avg 23µs/call
82252134µs5227µs return if !$stmnt;
# spent 27µs making 52 calls to PPI::Util::TRUE, avg 515ns/call
82352313µs5276µs return $stmnt->isa('PPI::Statement::Sub') && $sib eq 'sub';
# spent 76µs making 52 calls to UNIVERSAL::isa, avg 1µs/call
824}
825
826#-----------------------------------------------------------------------------
827
828
# spent 48.3ms (2.32+46.0) within Perl::Critic::Utils::is_function_call which was called 79 times, avg 611µs/call: # 55 times (1.71ms+37.5ms) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::violates at line 101 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm, avg 714µs/call # 10 times (308µs+3.84ms) by Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::violates at line 50 of Perl/Critic/Policy/BuiltinFunctions/ProhibitStringyEval.pm, avg 415µs/call # 6 times (130µs+1.91ms) by Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::violates at line 38 of Perl/Critic/Policy/InputOutput/ProhibitBarewordFileHandles.pm, avg 340µs/call # 6 times (127µs+1.85ms) by Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::violates at line 45 of Perl/Critic/Policy/InputOutput/ProhibitTwoArgOpen.pm, avg 330µs/call # once (22µs+410µs) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::_is_topic_mutating_substr at line 230 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm # once (22µs+409µs) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::_is_topic_mutating_func at line 210 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
sub is_function_call {
8297928µs my $elem = shift;
83079257µs7942µs return if !$elem;
# spent 42µs making 79 calls to PPI::Util::TRUE, avg 537ns/call
831
83279125µs7910.0ms return if is_hash_key($elem);
# spent 10.0ms making 79 calls to Perl::Critic::Utils::is_hash_key, avg 127µs/call
83377129µs776.15ms return if is_method_call($elem);
# spent 6.15ms making 77 calls to Perl::Critic::Utils::is_method_call, avg 80µs/call
83477132µs778.42ms return if is_class_name($elem);
# spent 8.42ms making 77 calls to Perl::Critic::Utils::is_class_name, avg 109µs/call
83577128µs774.84ms return if is_subroutine_name($elem);
# spent 4.84ms making 77 calls to Perl::Critic::Utils::is_subroutine_name, avg 63µs/call
83677112µs775.13ms return if is_included_module_name($elem);
# spent 5.13ms making 77 calls to Perl::Critic::Utils::is_included_module_name, avg 67µs/call
8377799µs772.34ms return if is_package_declaration($elem);
# spent 2.34ms making 77 calls to Perl::Critic::Utils::is_package_declaration, avg 30µs/call
83877206µs772.18ms return if is_perl_bareword($elem);
# spent 2.18ms making 77 calls to Perl::Critic::Utils::is_perl_bareword, avg 28µs/call
83977186µs771.65ms return if is_perl_filehandle($elem);
# spent 1.65ms making 77 calls to Perl::Critic::Utils::is_perl_filehandle, avg 21µs/call
84077143µs775.20ms return if is_label_pointer($elem);
# spent 5.20ms making 77 calls to Perl::Critic::Utils::is_label_pointer, avg 67µs/call
841
84277194µs return 1;
843}
844
845#-----------------------------------------------------------------------------
846
847sub is_script {
848 my $doc = shift;
849
850 warnings::warnif(
851 'deprecated',
852 'Perl::Critic::Utils::is_script($doc) deprecated, use $doc->is_program() instead.', ## no critic (ValuesAndExpressions::RequireInterpolationOfMetachars)
853 );
854
855 return $doc->is_program()
856 if blessed($doc) && $doc->isa('Perl::Critic::Document');
857
858 return 1 if shebang_line($doc);
859 return 1 if _is_PL_file($doc);
860 return 0;
861}
862
863#-----------------------------------------------------------------------------
864
865sub _is_PL_file { ## no critic (NamingConventions::Capitalization)
866 my ($doc) = @_;
867 return if not $doc->can('filename');
868 my $filename = $doc->filename() || return;
869 return 1 if $filename =~ m/[.] PL \z/xms;
870 return 0;
871}
872
873#-----------------------------------------------------------------------------
874
875sub is_in_void_context {
876 my ($token) = @_;
877
878 # If part of a collective, can't be void.
879 return if $token->sprevious_sibling();
880
881 my $parent = $token->statement()->parent();
882 if ($parent) {
883 return if $parent->isa('PPI::Structure::List');
884 return if $parent->isa('PPI::Structure::For');
885 return if $parent->isa('PPI::Structure::Condition');
886 return if $parent->isa('PPI::Structure::Constructor');
887 return if $parent->isa('PPI::Structure::Subscript');
888
889 my $grand_parent = $parent->parent();
890 if ($grand_parent) {
891 return if
892 $parent->isa('PPI::Structure::Block')
893 and not $grand_parent->isa('PPI::Statement::Compound');
894 }
895 }
896
897 return $TRUE;
898}
899
900#-----------------------------------------------------------------------------
901
902
# spent 3.17ms (1.36+1.81) within Perl::Critic::Utils::policy_long_name which was called 282 times, avg 11µs/call: # 141 times (731µs+1.00ms) by Perl::Critic::PolicyFactory::create_policy at line 183 of Perl/Critic/PolicyFactory.pm, avg 12µs/call # 141 times (630µs+805µs) by Perl::Critic::UserProfile::raw_policy_params at line 78 of Perl/Critic/UserProfile.pm, avg 10µs/call
sub policy_long_name {
90328236µs my ( $policy_name ) = @_;
9042821.94ms8462.16ms if ( $policy_name !~ m{ \A $POLICY_NAMESPACE }xms ) {
# spent 1.52ms making 282 calls to Perl::Critic::Utils::CORE:regcomp, avg 5µs/call # spent 352µs making 282 calls to Readonly::Scalar::FETCH, avg 1µs/call # spent 284µs making 282 calls to Perl::Critic::Utils::CORE:match, avg 1µs/call
905 $policy_name = $POLICY_NAMESPACE . q{::} . $policy_name;
906 }
907282579µs return $policy_name;
908}
909
910#-----------------------------------------------------------------------------
911
912
# spent 18.1ms (6.60+11.5) within Perl::Critic::Utils::policy_short_name which was called 1291 times, avg 14µs/call: # 586 times (3.17ms+6.90ms) by Perl::Critic::Policy::get_short_name at line 264 of Perl/Critic/Policy.pm, avg 17µs/call # 141 times (749µs+1.07ms) by Perl::Critic::UserProfile::policy_is_disabled at line 96 of Perl/Critic/UserProfile.pm, avg 13µs/call # 141 times (687µs+960µs) by Perl::Critic::UserProfile::policy_is_enabled at line 109 of Perl/Critic/UserProfile.pm, avg 12µs/call # 141 times (690µs+873µs) by Perl::Critic::PolicyFactory::create_policy at line 184 of Perl/Critic/PolicyFactory.pm, avg 11µs/call # 141 times (683µs+831µs) by Perl::Critic::UserProfile::raw_policy_params at line 79 of Perl/Critic/UserProfile.pm, avg 11µs/call # 141 times (628µs+847µs) by Perl::Critic::UserProfile::policy_params at line 64 of Perl/Critic/UserProfile.pm, avg 10µs/call
sub policy_short_name {
9131291348µs my ( $policy_name ) = @_;
91412919.60ms387313.2ms $policy_name =~ s{\A $POLICY_NAMESPACE ::}{}xms;
# spent 9.80ms making 1291 calls to Perl::Critic::Utils::CORE:regcomp, avg 8µs/call # spent 1.77ms making 1291 calls to Readonly::Scalar::FETCH, avg 1µs/call # spent 1.68ms making 1291 calls to Perl::Critic::Utils::CORE:subst, avg 1µs/call
91512912.73ms return $policy_name;
916}
917
918#-----------------------------------------------------------------------------
919
920
# spent 2.86ms (613µs+2.25) within Perl::Critic::Utils::first_arg which was called 66 times, avg 43µs/call: # 55 times (514µs+1.98ms) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::violates at line 104 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm, avg 45µs/call # 10 times (96µs+242µs) by Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::violates at line 52 of Perl/Critic/Policy/BuiltinFunctions/ProhibitStringyEval.pm, avg 34µs/call # once (3µs+22µs) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::_is_topic_mutating_func at line 214 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
sub first_arg {
9216621µs my $elem = shift;
9226690µs662.12ms my $sib = $elem->snext_sibling();
# spent 2.12ms making 66 calls to PPI::Element::snext_sibling, avg 32µs/call
92366172µs6537µs return if !$sib;
# spent 37µs making 65 calls to PPI::Util::TRUE, avg 565ns/call
924
92565248µs6589µs if ( $sib->isa('PPI::Structure::List') ) {
# spent 89µs making 65 calls to UNIVERSAL::isa, avg 1µs/call
926
927 my $expr = $sib->schild(0);
928 return if !$expr;
929 return $expr->isa('PPI::Statement') ? $expr->schild(0) : $expr;
930 }
931
93265139µs return $sib;
933}
934
935#-----------------------------------------------------------------------------
936
937
# spent 8.72ms (1.45+7.27) within Perl::Critic::Utils::parse_arg_list which was called 18 times, avg 484µs/call: # 7 times (537µs+2.98ms) by Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::violates at line 48 of Perl/Critic/Policy/InputOutput/RequireEncodingWithUTF8Layer.pm, avg 503µs/call # 5 times (458µs+2.00ms) by Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::violates at line 40 of Perl/Critic/Policy/InputOutput/ProhibitBarewordFileHandles.pm, avg 492µs/call # 5 times (383µs+1.92ms) by Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::violates at line 50 of Perl/Critic/Policy/InputOutput/ProhibitTwoArgOpen.pm, avg 461µs/call # once (72µs+361µs) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::_is_topic_mutating_substr at line 233 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
sub parse_arg_list {
938184µs my $elem = shift;
9391823µs18464µs my $sib = $elem->snext_sibling();
# spent 464µs making 18 calls to PPI::Element::snext_sibling, avg 26µs/call
9401850µs1810µs return if !$sib;
# spent 10µs making 18 calls to PPI::Util::TRUE, avg 561ns/call
941
9421870µs1827µs if ( $sib->isa('PPI::Structure::List') ) {
# spent 27µs making 18 calls to UNIVERSAL::isa, avg 1µs/call
943
944 #Pull siblings from list
945 my @list_contents = $sib->schildren();
946 return if not @list_contents;
947
948 my @list_expressions;
949 foreach my $item (@list_contents) {
950 if (
951 is_ppi_expression_or_generic_statement($item)
952 ) {
953 push
954 @list_expressions,
955 split_nodes_on_comma( $item->schildren() );
956 }
957 else {
958 push @list_expressions, $item;
959 }
960 }
961
962 return @list_expressions;
963 }
964 else {
965
966 #Gather up remaining nodes in the statement
967186µs my $iter = $elem;
968188µs my @arg_list = ();
969
9701868µs36430µs while ($iter = $iter->snext_sibling() ) {
# spent 420µs making 18 calls to PPI::Element::snext_sibling, avg 23µs/call # spent 10µs making 18 calls to PPI::Util::TRUE, avg 528ns/call
971120339µs126206µs last if $iter->isa('PPI::Token::Structure') and $iter eq $SCOLON;
# spent 128µs making 120 calls to UNIVERSAL::isa, avg 1µs/call # spent 74µs making 3 calls to PPI::Element::__eq, avg 24µs/call # spent 4µs making 3 calls to Readonly::Scalar::FETCH, avg 1µs/call
972117422µs217766µs last if $iter->isa('PPI::Token::Operator')
# spent 623µs making 50 calls to Perl::Critic::Utils::precedence_of, avg 12µs/call # spent 88µs making 117 calls to UNIVERSAL::isa, avg 753ns/call # spent 55µs making 50 calls to Readonly::Scalar::FETCH, avg 1µs/call
973 and $MIN_PRECEDENCE_TO_TERMINATE_PARENLESS_ARG_LIST <=
974 precedence_of( $iter );
975105415µs2073.57ms push @arg_list, $iter;
# spent 3.52ms making 105 calls to PPI::Element::snext_sibling, avg 34µs/call # spent 52µs making 102 calls to PPI::Util::TRUE, avg 510ns/call
976 }
9771890µs181.80ms return split_nodes_on_comma( @arg_list );
# spent 1.80ms making 18 calls to Perl::Critic::Utils::split_nodes_on_comma, avg 100µs/call
978 }
979}
980
981#---------------------------------
982
983
# spent 1.80ms (692µs+1.10) within Perl::Critic::Utils::split_nodes_on_comma which was called 18 times, avg 100µs/call: # 18 times (692µs+1.10ms) by Perl::Critic::Utils::parse_arg_list at line 977, avg 100µs/call
sub split_nodes_on_comma {
9841815µs my @nodes = @_;
985
986184µs my $i = 0;
987182µs my @node_stacks;
9881816µs for my $node (@nodes) {
989105569µs2541.10ms if (
# spent 886µs making 41 calls to PPI::Element::__eq, avg 22µs/call # spent 168µs making 172 calls to UNIVERSAL::isa, avg 977ns/call # spent 50µs making 41 calls to Readonly::Scalar::FETCH, avg 1µs/call
990 $node->isa('PPI::Token::Operator')
991 and ($node eq $COMMA or $node eq $FATCOMMA)
992 ) {
9933811µs if (@node_stacks) {
994 $i++; #Move forward to next 'node stack'
995 }
9963819µs next;
997 } elsif ( $node->isa('PPI::Token::QuoteLike::Words' )) {
998 my $section = $node->{sections}->[0];
999 my @words = words_from_string(substr $node->content, $section->{position}, $section->{size});
1000 my $loc = $node->location;
1001 for my $word (@words) {
1002 my $token = PPI::Token::Quote::Single->new(q{'} . $word . q{'});
1003 $token->{_location} = $loc;
1004 push @{ $node_stacks[$i++] }, $token;
1005 }
1006 next;
1007 }
10086757µs push @{ $node_stacks[$i] }, $node;
1009 }
10101848µs return @node_stacks;
1011}
1012
1013#-----------------------------------------------------------------------------
1014
1015# XXX: You must keep the regular expressions in extras/perlcritic.el in sync
1016# if you change these.
101712µs136µsReadonly::Hash my %FORMAT_OF => (
# spent 36µs making 1 call to Readonly::Hash
1018 1 => "%f:%l:%c:%m\n",
1019 2 => "%f: (%l:%c) %m\n",
1020 3 => "%m at %f line %l\n",
1021 4 => "%m at line %l, column %c. %e. (Severity: %s)\n",
1022 5 => "%f: %m at line %l, column %c. %e. (Severity: %s)\n",
1023 6 => "%m at line %l, near '%r'. (Severity: %s)\n",
1024 7 => "%f: %m at line %l near '%r'. (Severity: %s)\n",
1025 8 => "[%p] %m at line %l, column %c. (Severity: %s)\n",
1026 9 => "[%p] %m at line %l, near '%r'. (Severity: %s)\n",
1027 10 => "%m at line %l, column %c.\n %p (Severity: %s)\n%d\n",
1028 11 => "%m at line %l, near '%r'.\n %p (Severity: %s)\n%d\n",
1029);
1030
103111µs123µsReadonly::Scalar our $DEFAULT_VERBOSITY => 4;
# spent 23µs making 1 call to Readonly::Scalar
10321800ns121µsReadonly::Scalar our $DEFAULT_VERBOSITY_WITH_FILE_NAME => 5;
# spent 21µs making 1 call to Readonly::Scalar
103316µs333µsReadonly::Scalar my $DEFAULT_FORMAT => $FORMAT_OF{$DEFAULT_VERBOSITY};
# spent 27µs making 1 call to Readonly::Scalar # spent 6µs making 2 calls to Readonly::Scalar::FETCH, avg 3µs/call
1034
1035
# spent 11µs (8+3) within Perl::Critic::Utils::is_valid_numeric_verbosity which was called: # once (8µs+3µs) by Perl::Critic::Config::_validate_and_save_verbosity at line 487 of Perl/Critic/Config.pm
sub is_valid_numeric_verbosity {
10361400ns my ($verbosity) = @_;
1037
103817µs13µs return exists $FORMAT_OF{$verbosity};
# spent 3µs making 1 call to Readonly::Hash::EXISTS
1039}
1040
1041sub verbosity_to_format {
1042 my ($verbosity) = @_;
1043 return $DEFAULT_FORMAT if not defined $verbosity;
1044 return $FORMAT_OF{abs int $verbosity} || $DEFAULT_FORMAT if is_integer($verbosity);
1045 return interpolate( $verbosity ); #Otherwise, treat as a format spec
1046}
1047
1048#-----------------------------------------------------------------------------
1049
105011µs124µsReadonly::Hash my %SEVERITY_NUMBER_OF => (
# spent 24µs making 1 call to Readonly::Hash
1051 gentle => 5,
1052 stern => 4,
1053 harsh => 3,
1054 cruel => 2,
1055 brutal => 1,
1056);
1057
1058Readonly::Array our @SEVERITY_NAMES => #This is exported!
1059 sort
1060156µs22118µs { $SEVERITY_NUMBER_OF{$a} <=> $SEVERITY_NUMBER_OF{$b} }
# spent 69µs making 1 call to Perl::Critic::Utils::CORE:sort # spent 22µs making 1 call to Readonly::Array # spent 19µs making 14 calls to Readonly::Hash::FETCH, avg 1µs/call # spent 6µs making 5 calls to Readonly::Hash::NEXTKEY, avg 1µs/call # spent 2µs making 1 call to Readonly::Hash::FIRSTKEY
1061 keys %SEVERITY_NUMBER_OF;
1062
1063sub severity_to_number {
1064 my ($severity) = @_;
1065 return _normalize_severity( $severity ) if is_integer( $severity );
1066 my $severity_number = $SEVERITY_NUMBER_OF{lc $severity};
1067
1068 if ( not defined $severity_number ) {
1069 throw_generic qq{Invalid severity: "$severity"};
1070 }
1071
1072 return $severity_number;
1073}
1074
1075sub _normalize_severity {
1076 my $s = shift || return $SEVERITY_HIGHEST;
1077 $s = $s > $SEVERITY_HIGHEST ? $SEVERITY_HIGHEST : $s;
1078 $s = $s < $SEVERITY_LOWEST ? $SEVERITY_LOWEST : $s;
1079 return $s;
1080}
1081
1082#-----------------------------------------------------------------------------
1083
108411µs125µsReadonly::Array my @SKIP_DIR => qw( CVS RCS .svn _darcs {arch} .bzr .cdv .git .hg .pc _build blib );
# spent 25µs making 1 call to Readonly::Array
108519µs390µsReadonly::Hash my %SKIP_DIR => hashify( @SKIP_DIR );
# spent 51µs making 1 call to Perl::Critic::Utils::hashify # spent 38µs making 1 call to Readonly::Hash # spent 1µs making 1 call to Readonly::Array::FETCHSIZE
1086
1087
# spent 10.9ms (2.79+8.12) within Perl::Critic::Utils::all_perl_files which was called: # once (2.79ms+8.12ms) by Perl::Critic::Command::_get_input at line 220 of Perl/Critic/Command.pm
sub all_perl_files {
1088
1089 # Recursively searches a list of directories and returns the paths
1090 # to files that seem to be Perl source code. This subroutine was
1091 # poached from Test::Perl::Critic.
1092
109311µs my @queue = @_;
10941400ns my @code_files = ();
1095
10961700ns while (@queue) {
109716257µs my $file = shift @queue;
1098162803µs162529µs if ( -d $file ) {
# spent 529µs making 162 calls to Perl::Critic::Utils::CORE:ftdir, avg 3µs/call
109918220µs18160µs opendir my ($dh), $file or next;
# spent 160µs making 18 calls to Perl::Critic::Utils::CORE:open_dir, avg 9µs/call
110018472µs36338µs my @newfiles = sort readdir $dh;
# spent 311µs making 18 calls to Perl::Critic::Utils::CORE:readdir, avg 17µs/call # spent 28µs making 18 calls to Perl::Critic::Utils::CORE:sort, avg 2µs/call
11011892µs1856µs closedir $dh;
# spent 56µs making 18 calls to Perl::Critic::Utils::CORE:closedir, avg 3µs/call
1102
110318125µs18349µs @newfiles = File::Spec->no_upwards(@newfiles);
# spent 349µs making 18 calls to File::Spec::Unix::no_upwards, avg 19µs/call
110418463µs161232µs @newfiles = grep { not $SKIP_DIR{$_} } @newfiles;
# spent 232µs making 161 calls to Readonly::Hash::FETCH, avg 1µs/call
11051791.89ms6442.13ms push @queue, map { File::Spec->catfile($file, $_) } @newfiles;
# spent 1.41ms making 161 calls to File::Spec::Unix::catfile, avg 9µs/call # spent 512µs making 161 calls to File::Spec::Unix::catdir, avg 3µs/call # spent 208µs making 322 calls to File::Spec::Unix::canonpath, avg 645ns/call
1106 }
1107
1108162996µs4505.04ms if ( (-f $file) && ! _is_backup($file) && _is_perl($file) ) {
# spent 3.99ms making 144 calls to Perl::Critic::Utils::_is_backup, avg 28µs/call # spent 709µs making 144 calls to Perl::Critic::Utils::_is_perl, avg 5µs/call # spent 338µs making 162 calls to Perl::Critic::Utils::CORE:ftfile, avg 2µs/call
1109 push @code_files, $file;
1110 }
1111 }
1112143µs return @code_files;
1113}
1114
1115
1116#-----------------------------------------------------------------------------
1117# Decide if it's some sort of backup file
1118
1119
# spent 3.99ms (3.85+140µs) within Perl::Critic::Utils::_is_backup which was called 144 times, avg 28µs/call: # 144 times (3.85ms+140µs) by Perl::Critic::Utils::all_perl_files at line 1108, avg 28µs/call
sub _is_backup {
112014430µs my ($file) = @_;
1121144243µs14450µs return 1 if $file =~ m{ [.] swp \z}xms;
# spent 50µs making 144 calls to Perl::Critic::Utils::CORE:match, avg 345ns/call
1122144193µs14432µs return 1 if $file =~ m{ [.] bak \z}xms;
# spent 32µs making 144 calls to Perl::Critic::Utils::CORE:match, avg 221ns/call
11231443.14ms14429µs return 1 if $file =~ m{ ~ \z}xms;
# spent 29µs making 144 calls to Perl::Critic::Utils::CORE:match, avg 204ns/call
1124144172µs14430µs return 1 if $file =~ m{ \A [#] .+ [#] \z}xms;
# spent 30µs making 144 calls to Perl::Critic::Utils::CORE:match, avg 206ns/call
1125144217µs return;
1126}
1127
1128#-----------------------------------------------------------------------------
1129# Returns true if the argument ends with a perl-ish file
1130# extension, or if it has a shebang-line containing 'perl' This
1131# subroutine was also poached from Test::Perl::Critic
1132
1133
# spent 709µs (549+160) within Perl::Critic::Utils::_is_perl which was called 144 times, avg 5µs/call: # 144 times (549µs+160µs) by Perl::Critic::Utils::all_perl_files at line 1108, avg 5µs/call
sub _is_perl {
113414430µs my ($file) = @_;
1135
1136 #Check filename extensions
1137144231µs14444µs return 1 if $file =~ m{ [.] PL \z}xms;
# spent 44µs making 144 calls to Perl::Critic::Utils::CORE:match, avg 306ns/call
1138144485µs144116µs return 1 if $file =~ m{ [.] p[lm] \z}xms;
# spent 116µs making 144 calls to Perl::Critic::Utils::CORE:match, avg 804ns/call
1139 return 1 if $file =~ m{ [.] t \z}xms;
1140
1141 #Check for shebang
1142 open my $fh, '<', $file or return;
1143 my $first = <$fh>;
1144 close $fh or throw_generic "unable to close $file: $OS_ERROR";
1145
1146 return 1 if defined $first && ( $first =~ m{ \A [#]!.*perl }xms );
1147 return;
1148}
1149
1150#-----------------------------------------------------------------------------
1151
1152
# spent 4.02ms (1.85+2.17) within Perl::Critic::Utils::shebang_line which was called 144 times, avg 28µs/call: # 144 times (1.85ms+2.17ms) by Perl::Critic::Document::_determine_is_module at line 581 of Perl/Critic/Document.pm, avg 28µs/call
sub shebang_line {
115314461µs my $doc = shift;
1154144461µs1441.82ms my $first_element = $doc->first_element();
# spent 1.82ms making 144 calls to Perl::Critic::Document::AUTOLOAD, avg 13µs/call
1155144490µs144118µs return if not $first_element;
# spent 118µs making 144 calls to PPI::Util::TRUE, avg 816ns/call
1156144907µs144242µs return if not $first_element->isa('PPI::Token::Comment');
# spent 242µs making 144 calls to UNIVERSAL::isa, avg 2µs/call
1157 my $location = $first_element->location();
1158 return if !$location;
1159 # The shebang must be the first two characters in the file, according to
1160 # http://en.wikipedia.org/wiki/Shebang_(Unix)
1161 return if $location->[0] != 1; # line number
1162 return if $location->[1] != 1; # column number
1163 my $shebang = $first_element->content;
1164 return if $shebang !~ m{ \A [#]! }xms;
1165 return $shebang;
1166}
1167
1168#-----------------------------------------------------------------------------
1169
1170
# spent 90µs within Perl::Critic::Utils::words_from_string which was called 40 times, avg 2µs/call: # 27 times (62µs+0s) by Perl::Critic::PolicyParameter::Behavior::StringList::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/StringList.pm:60] at line 51 of Perl/Critic/PolicyParameter/Behavior/StringList.pm, avg 2µs/call # 5 times (12µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 723 of Perl/Critic/Config.pm, avg 2µs/call # 5 times (10µs+0s) by Perl::Critic::PolicyParameter::Behavior::Enumeration::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/Enumeration.pm:93] at line 70 of Perl/Critic/PolicyParameter/Behavior/Enumeration.pm, avg 2µs/call # once (4µs+0s) by Perl::Critic::OptionsProcessor::_init at line 45 of Perl/Critic/OptionsProcessor.pm # once (1µs+0s) by Perl::Critic::OptionsProcessor::_init at line 51 of Perl/Critic/OptionsProcessor.pm # once (1µs+0s) by Perl::Critic::OptionsProcessor::_init at line 48 of Perl/Critic/OptionsProcessor.pm
sub words_from_string {
1171409µs my $str = shift;
1172
117340125µs return split q{ }, $str; # This must be a literal space, not $SPACE
1174}
1175
1176#-----------------------------------------------------------------------------
1177
1178sub is_unchecked_call {
1179 my $elem = shift;
1180
1181 return if not is_function_call( $elem );
1182
1183 # check to see if there's an '=' or 'unless' or something before this.
1184 if( my $sib = $elem->sprevious_sibling() ){
1185 return if $sib;
1186 }
1187
1188
1189 if( my $statement = $elem->statement() ){
1190
1191 # "open or die" is OK.
1192 # We can't check snext_sibling for 'or' since the next siblings are an
1193 # unknown number of arguments to the system call. Instead, check all of
1194 # the elements to this statement to see if we find 'or' or '||'.
1195
1196 my $or_operators = sub {
1197 my (undef, $elem) = @_; ## no critic(Variables::ProhibitReusedNames)
1198 return if not $elem->isa('PPI::Token::Operator');
1199 return if $elem ne q{or} && $elem ne q{||};
1200 return 1;
1201 };
1202
1203 return if $statement->find( $or_operators );
1204
1205
1206 if( my $parent = $elem->statement()->parent() ){
1207
1208 # Check if we're in an if( open ) {good} else {bad} condition
1209 return if $parent->isa('PPI::Structure::Condition');
1210
1211 # Return val could be captured in data structure and checked later
1212 return if $parent->isa('PPI::Structure::Constructor');
1213
1214 # "die if not ( open() )" - It's in list context.
1215 if ( $parent->isa('PPI::Structure::List') ) {
1216 if( my $uncle = $parent->sprevious_sibling() ){
1217 return if $uncle;
1218 }
1219 }
1220 }
1221 }
1222
1223 return if _is_fatal($elem);
1224
1225 # Otherwise, return. this system call is unchecked.
1226 return 1;
1227}
1228
1229# Based upon autodie 2.10.
12305276µs5259µsReadonly::Hash my %AUTODIE_PARAMETER_TO_AFFECTED_BUILTINS_MAP => (
# spent 59µs making 52 calls to Perl::Critic::Utils::hashify, avg 1µs/call
1231 # Map builtins to themselves.
1232 (
1233197µs141.80ms map { $_ => { hashify( $_ ) } }
# spent 1.74ms making 1 call to Readonly::Hash # spent 62µs making 13 calls to Perl::Critic::Utils::hashify, avg 5µs/call
1234 qw<
1235 accept bind binmode chdir chmod close closedir connect
1236 dbmclose dbmopen exec fcntl fileno flock fork getsockopt ioctl
1237 link listen mkdir msgctl msgget msgrcv msgsnd open opendir
1238 pipe read readlink recv rename rmdir seek semctl semget semop
1239 send setsockopt shmctl shmget shmread shutdown socketpair
1240 symlink sysopen sysread sysseek system syswrite truncate umask
1241 unlink
1242 >
1243 ),
1244
1245 # Generate these using tools/dump-autodie-tag-contents
1246 ':threads' => { hashify( qw< fork > ) },
1247 ':system' => { hashify( qw< exec system > ) },
1248 ':dbm' => { hashify( qw< dbmclose dbmopen > ) },
1249 ':semaphore' => { hashify( qw< semctl semget semop > ) },
1250 ':shm' => { hashify( qw< shmctl shmget shmread > ) },
1251 ':msg' => { hashify( qw< msgctl msgget msgrcv msgsnd > ) },
1252 ':file' => {
1253 hashify(
1254 qw<
1255 binmode chmod close fcntl fileno flock ioctl open sysopen
1256 truncate
1257 >
1258 )
1259 },
1260 ':filesys' => {
1261 hashify(
1262 qw<
1263 chdir closedir link mkdir opendir readlink rename rmdir
1264 symlink umask unlink
1265 >
1266 )
1267 },
1268 ':ipc' => {
1269 hashify(
1270 qw<
1271 msgctl msgget msgrcv msgsnd pipe semctl semget semop shmctl
1272 shmget shmread
1273 >
1274 )
1275 },
1276 ':socket' => {
1277 hashify(
1278 qw<
1279 accept bind connect getsockopt listen recv send setsockopt
1280 shutdown socketpair
1281 >
1282 )
1283 },
1284 ':io' => {
1285 hashify(
1286 qw<
1287 accept bind binmode chdir chmod close closedir connect
1288 dbmclose dbmopen fcntl fileno flock getsockopt ioctl link
1289 listen mkdir msgctl msgget msgrcv msgsnd open opendir pipe
1290 read readlink recv rename rmdir seek semctl semget semop send
1291 setsockopt shmctl shmget shmread shutdown socketpair symlink
1292 sysopen sysread sysseek syswrite truncate umask unlink
1293 >
1294 )
1295 },
1296 ':default' => {
1297 hashify(
1298 qw<
1299 accept bind binmode chdir chmod close closedir connect
1300 dbmclose dbmopen fcntl fileno flock fork getsockopt ioctl link
1301 listen mkdir msgctl msgget msgrcv msgsnd open opendir pipe
1302 read readlink recv rename rmdir seek semctl semget semop send
1303 setsockopt shmctl shmget shmread shutdown socketpair symlink
1304 sysopen sysread sysseek syswrite truncate umask unlink
1305 >
1306 )
1307 },
1308 ':all' => {
1309 hashify(
1310 qw<
1311 accept bind binmode chdir chmod close closedir connect
1312 dbmclose dbmopen exec fcntl fileno flock fork getsockopt ioctl
1313 link listen mkdir msgctl msgget msgrcv msgsnd open opendir
1314 pipe read readlink recv rename rmdir seek semctl semget semop
1315 send setsockopt shmctl shmget shmread shutdown socketpair
1316 symlink sysopen sysread sysseek system syswrite truncate umask
1317 unlink
1318 >
1319 )
1320 },
1321);
1322
1323sub _is_fatal {
1324 my ($elem) = @_;
1325
1326 my $top = $elem->top();
1327 return if not $top->isa('PPI::Document');
1328
1329 my $includes = $top->find('PPI::Statement::Include');
1330 return if not $includes;
1331
1332 for my $include (@{$includes}) {
1333 next if 'use' ne $include->type();
1334
1335 if ('Fatal' eq $include->module()) {
1336 my @args = parse_arg_list($include->schild(1));
1337 foreach my $arg (@args) {
1338 return $TRUE if $arg->[0]->isa('PPI::Token::Quote') && $elem eq $arg->[0]->string();
1339 }
1340 }
1341 elsif ('Fatal::Exception' eq $include->module()) {
1342 my @args = parse_arg_list($include->schild(1));
1343 shift @args; # skip exception class name
1344 foreach my $arg (@args) {
1345 return $TRUE if $arg->[0]->isa('PPI::Token::Quote') && $elem eq $arg->[0]->string();
1346 }
1347 }
1348 elsif ('autodie' eq $include->pragma()) {
1349 return _is_covered_by_autodie($elem, $include);
1350 }
1351 }
1352
1353 return;
1354}
1355
1356sub _is_covered_by_autodie {
1357 my ($elem, $include) = @_;
1358
1359 my @args = parse_arg_list($include->schild(1));
1360
1361 if (@args) {
1362 foreach my $arg (@args) {
1363 my $builtins =
1364 $AUTODIE_PARAMETER_TO_AFFECTED_BUILTINS_MAP{
1365 $arg->[0]->string
1366 };
1367
1368 return $TRUE if $builtins and $builtins->{$elem->content()};
1369 }
1370 }
1371 else {
1372 my $builtins =
1373 $AUTODIE_PARAMETER_TO_AFFECTED_BUILTINS_MAP{':default'};
1374
1375 return $TRUE if $builtins and $builtins->{$elem->content()};
1376 }
1377
1378 return;
1379}
1380
13811106µs1;
1382
1383__END__
 
# spent 56µs within Perl::Critic::Utils::CORE:closedir which was called 18 times, avg 3µs/call: # 18 times (56µs+0s) by Perl::Critic::Utils::all_perl_files at line 1101, avg 3µs/call
sub Perl::Critic::Utils::CORE:closedir; # opcode
# spent 529µs within Perl::Critic::Utils::CORE:ftdir which was called 162 times, avg 3µs/call: # 162 times (529µs+0s) by Perl::Critic::Utils::all_perl_files at line 1098, avg 3µs/call
sub Perl::Critic::Utils::CORE:ftdir; # opcode
# spent 338µs within Perl::Critic::Utils::CORE:ftfile which was called 162 times, avg 2µs/call: # 162 times (338µs+0s) by Perl::Critic::Utils::all_perl_files at line 1108, avg 2µs/call
sub Perl::Critic::Utils::CORE:ftfile; # opcode
# spent 652µs (635+17) within Perl::Critic::Utils::CORE:match which was called 1161 times, avg 562ns/call: # 282 times (284µs+0s) by Perl::Critic::Utils::policy_long_name at line 904, avg 1µs/call # 144 times (116µs+0s) by Perl::Critic::Utils::_is_perl at line 1138, avg 804ns/call # 144 times (50µs+0s) by Perl::Critic::Utils::_is_backup at line 1121, avg 345ns/call # 144 times (44µs+0s) by Perl::Critic::Utils::_is_perl at line 1137, avg 306ns/call # 144 times (32µs+0s) by Perl::Critic::Utils::_is_backup at line 1122, avg 221ns/call # 144 times (30µs+0s) by Perl::Critic::Utils::_is_backup at line 1124, avg 206ns/call # 144 times (29µs+0s) by Perl::Critic::Utils::_is_backup at line 1123, avg 204ns/call # 12 times (45µs+17µs) by Perl::Critic::Utils::is_label_pointer at line 771, avg 5µs/call # 3 times (5µs+0s) by Perl::Critic::Utils::is_integer at line 756, avg 2µs/call
sub Perl::Critic::Utils::CORE:match; # opcode
# spent 160µs within Perl::Critic::Utils::CORE:open_dir which was called 18 times, avg 9µs/call: # 18 times (160µs+0s) by Perl::Critic::Utils::all_perl_files at line 1099, avg 9µs/call
sub Perl::Critic::Utils::CORE:open_dir; # opcode
# spent 311µs within Perl::Critic::Utils::CORE:readdir which was called 18 times, avg 17µs/call: # 18 times (311µs+0s) by Perl::Critic::Utils::all_perl_files at line 1100, avg 17µs/call
sub Perl::Critic::Utils::CORE:readdir; # opcode
# spent 11.3ms (9.21+2.12) within Perl::Critic::Utils::CORE:regcomp which was called 1573 times, avg 7µs/call: # 1291 times (8.04ms+1.77ms) by Perl::Critic::Utils::policy_short_name at line 914, avg 8µs/call # 282 times (1.17ms+352µs) by Perl::Critic::Utils::policy_long_name at line 904, avg 5µs/call
sub Perl::Critic::Utils::CORE:regcomp; # opcode
# spent 96µs (78+19) within Perl::Critic::Utils::CORE:sort which was called 19 times, avg 5µs/call: # 18 times (28µs+0s) by Perl::Critic::Utils::all_perl_files at line 1100, avg 2µs/call # once (50µs+19µs) by Perl::Critic::Exception::Parse::BEGIN@18 at line 1060
sub Perl::Critic::Utils::CORE:sort; # opcode
# spent 1.68ms within Perl::Critic::Utils::CORE:subst which was called 1300 times, avg 1µs/call: # 1291 times (1.68ms+0s) by Perl::Critic::Utils::policy_short_name at line 914, avg 1µs/call # 9 times (4µs+0s) by Perl::Critic::Utils::_build_globals_without_sigils at line 395, avg 444ns/call
sub Perl::Critic::Utils::CORE:subst; # opcode