← 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.pm
StatementsExecuted 180470 statements in 364ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
302411639ms7.77sPerl::Critic::::_critiquePerl::Critic::_critique
1441122.6ms32.4sPerl::Critic::::critiquePerl::Critic::critique
1441116.9ms14.9sPerl::Critic::::_gather_violationsPerl::Critic::_gather_violations
1113.15ms1.33sPerl::Critic::::BEGIN@24Perl::Critic::BEGIN@24
1112.27ms44.2msPerl::Critic::::BEGIN@26Perl::Critic::BEGIN@26
144111.74ms4.52msPerl::Critic::::_futz_with_policy_orderPerl::Critic::_futz_with_policy_order
145221.33ms2.12msPerl::Critic::::policiesPerl::Critic::policies
578521.21ms1.21msPerl::Critic::::configPerl::Critic::config
111917┬Ás1.41msPerl::Critic::::BEGIN@27Perl::Critic::BEGIN@27
14411419┬Ás419┬ÁsPerl::Critic::::statisticsPerl::Critic::statistics
111214┬Ás966┬ÁsPerl::Critic::::BEGIN@23Perl::Critic::BEGIN@23
11122┬Ás426msPerl::Critic::::newPerl::Critic::new
11117┬Ás17┬ÁsPerl::Critic::::BEGIN@10Perl::Critic::BEGIN@10
11114┬Ás2.71msPerl::Critic::::BEGIN@20Perl::Critic::BEGIN@20
11110┬Ás33┬ÁsPerl::Critic::::BEGIN@21Perl::Critic::BEGIN@21
1119┬Ás9┬ÁsPerl::Critic::::BEGIN@25Perl::Critic::BEGIN@25
1118┬Ás316┬ÁsPerl::Critic::::BEGIN@28Perl::Critic::BEGIN@28
1118┬Ás13┬ÁsPerl::Critic::::BEGIN@12Perl::Critic::BEGIN@12
1118┬Ás28┬ÁsPerl::Critic::::BEGIN@15Perl::Critic::BEGIN@15
1118┬Ás20┬ÁsPerl::Critic::::BEGIN@11Perl::Critic::BEGIN@11
1118┬Ás382┬ÁsPerl::Critic::::BEGIN@14Perl::Critic::BEGIN@14
1117┬Ás16┬ÁsPerl::Critic::::BEGIN@17Perl::Critic::BEGIN@17
1114┬Ás4┬ÁsPerl::Critic::::BEGIN@19Perl::Critic::BEGIN@19
0000s0sPerl::Critic::::__ANON__[:210]Perl::Critic::__ANON__[:210]
0000s0sPerl::Critic::::add_policyPerl::Critic::add_policy
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;
9
10240┬Ás117┬Ás
# spent 17┬Ás within Perl::Critic::BEGIN@10 which was called: # once (17┬Ás+0s) by Perl::Critic::Command::_critique at line 10
use 5.006001;
# spent 17┬Ás making 1 call to Perl::Critic::BEGIN@10
11224┬Ás233┬Ás
# spent 20┬Ás (8+12) within Perl::Critic::BEGIN@11 which was called: # once (8┬Ás+12┬Ás) by Perl::Critic::Command::_critique at line 11
use strict;
# spent 20┬Ás making 1 call to Perl::Critic::BEGIN@11 # spent 12┬Ás making 1 call to strict::import
12222┬Ás218┬Ás
# spent 13┬Ás (8+5) within Perl::Critic::BEGIN@12 which was called: # once (8┬Ás+5┬Ás) by Perl::Critic::Command::_critique at line 12
use warnings;
# spent 13┬Ás making 1 call to Perl::Critic::BEGIN@12 # spent 5┬Ás making 1 call to warnings::import
13
14223┬Ás2757┬Ás
# spent 382┬Ás (8+375) within Perl::Critic::BEGIN@14 which was called: # once (8┬Ás+375┬Ás) by Perl::Critic::Command::_critique at line 14
use English qw(-no_match_vars);
# spent 382┬Ás making 1 call to Perl::Critic::BEGIN@14 # spent 375┬Ás making 1 call to English::import
15222┬Ás249┬Ás
# spent 28┬Ás (8+20) within Perl::Critic::BEGIN@15 which was called: # once (8┬Ás+20┬Ás) by Perl::Critic::Command::_critique at line 15
use Readonly;
# spent 28┬Ás making 1 call to Perl::Critic::BEGIN@15 # spent 20┬Ás making 1 call to Exporter::import
16
17220┬Ás225┬Ás
# spent 16┬Ás (7+9) within Perl::Critic::BEGIN@17 which was called: # once (7┬Ás+9┬Ás) by Perl::Critic::Command::_critique at line 17
use Exporter 'import';
# spent 16┬Ás making 1 call to Perl::Critic::BEGIN@17 # spent 9┬Ás making 1 call to Exporter::import
18
19220┬Ás14┬Ás
# spent 4┬Ás within Perl::Critic::BEGIN@19 which was called: # once (4┬Ás+0s) by Perl::Critic::Command::_critique at line 19
use File::Spec;
# spent 4┬Ás making 1 call to Perl::Critic::BEGIN@19
20233┬Ás25.40ms
# spent 2.71ms (14┬Ás+2.69) within Perl::Critic::BEGIN@20 which was called: # once (14┬Ás+2.69ms) by Perl::Critic::Command::_critique at line 20
use List::MoreUtils qw< firstidx >;
# spent 2.71ms making 1 call to Perl::Critic::BEGIN@20 # spent 2.69ms making 1 call to Exporter::Tiny::import
21224┬Ás256┬Ás
# spent 33┬Ás (10+23) within Perl::Critic::BEGIN@21 which was called: # once (10┬Ás+23┬Ás) by Perl::Critic::Command::_critique at line 21
use Scalar::Util qw< blessed >;
# spent 33┬Ás making 1 call to Perl::Critic::BEGIN@21 # spent 23┬Ás making 1 call to Exporter::import
22
23298┬Ás2980┬Ás
# spent 966┬Ás (214+752) within Perl::Critic::BEGIN@23 which was called: # once (214┬Ás+752┬Ás) by Perl::Critic::Command::_critique at line 23
use Perl::Critic::Exception::Configuration::Generic;
# spent 966┬Ás making 1 call to Perl::Critic::BEGIN@23 # spent 14┬Ás making 1 call to Exporter::import
24290┬Ás11.33s
# spent 1.33s (3.15ms+1.33) within Perl::Critic::BEGIN@24 which was called: # once (3.15ms+1.33s) by Perl::Critic::Command::_critique at line 24
use Perl::Critic::Config;
# spent 1.33s making 1 call to Perl::Critic::BEGIN@24
25223┬Ás19┬Ás
# spent 9┬Ás within Perl::Critic::BEGIN@25 which was called: # once (9┬Ás+0s) by Perl::Critic::Command::_critique at line 25
use Perl::Critic::Violation;
# spent 9┬Ás making 1 call to Perl::Critic::BEGIN@25
262110┬Ás144.2ms
# spent 44.2ms (2.27+41.9) within Perl::Critic::BEGIN@26 which was called: # once (2.27ms+41.9ms) by Perl::Critic::Command::_critique at line 26
use Perl::Critic::Document;
# spent 44.2ms making 1 call to Perl::Critic::BEGIN@26
272101┬Ás11.41ms
# spent 1.41ms (917┬Ás+489┬Ás) within Perl::Critic::BEGIN@27 which was called: # once (917┬Ás+489┬Ás) by Perl::Critic::Command::_critique at line 27
use Perl::Critic::Statistics;
# spent 1.41ms making 1 call to Perl::Critic::BEGIN@27
282612┬Ás2624┬Ás
# spent 316┬Ás (8+308) within Perl::Critic::BEGIN@28 which was called: # once (8┬Ás+308┬Ás) by Perl::Critic::Command::_critique at line 28
use Perl::Critic::Utils qw< :characters hashify shebang_line >;
# spent 316┬Ás making 1 call to Perl::Critic::BEGIN@28 # spent 308┬Ás making 1 call to Exporter::import
29
30#-----------------------------------------------------------------------------
31
321700nsour $VERSION = '1.121';
33
3413┬Ás137┬ÁsReadonly::Array our @EXPORT_OK => qw(critique);
# spent 37┬Ás making 1 call to Readonly::Array
35
36#=============================================================================
37# PUBLIC methods
38
39
# spent 426ms (22┬Ás+426) within Perl::Critic::new which was called: # once (22┬Ás+426ms) by Perl::Critic::Command::_critique at line 238 of Perl/Critic/Command.pm
sub new {
4011┬Ás my ( $class, %args ) = @_;
411800ns my $self = bless {}, $class;
4217┬Ás1426ms $self->{_config} = $args{-config} || Perl::Critic::Config->new( %args );
# spent 426ms making 1 call to Perl::Critic::Config::new
4316┬Ás117┬Ás $self->{_stats} = Perl::Critic::Statistics->new();
# spent 17┬Ás making 1 call to Perl::Critic::Statistics::new
4415┬Ás return $self;
45}
46
47#-----------------------------------------------------------------------------
48
49
# spent 1.21ms within Perl::Critic::config which was called 578 times, avg 2┬Ás/call: # 145 times (364┬Ás+0s) by Perl::Critic::policies at line 68, avg 3┬Ás/call # 144 times (366┬Ás+0s) by Perl::Critic::critique at line 103, avg 3┬Ás/call # 144 times (315┬Ás+0s) by Perl::Critic::_gather_violations at line 133, avg 2┬Ás/call # 144 times (167┬Ás+0s) by Perl::Critic::_gather_violations at line 128, avg 1┬Ás/call # once (1┬Ás+0s) by Perl::Critic::Command::_critique at line 241 of Perl/Critic/Command.pm
sub config {
50578192┬Ás my $self = shift;
515781.69ms return $self->{_config};
52}
53
54#-----------------------------------------------------------------------------
55
56sub add_policy {
57 my ( $self, @args ) = @_;
58 #Delegate to Perl::Critic::Config
59 return $self->config()->add_policy( @args );
60}
61
62#-----------------------------------------------------------------------------
63
64
# spent 2.12ms (1.33+794┬Ás) within Perl::Critic::policies which was called 145 times, avg 15┬Ás/call: # 144 times (1.32ms+789┬Ás) by Perl::Critic::critique at line 112, avg 15┬Ás/call # once (10┬Ás+5┬Ás) by Perl::Critic::Command::_critique at line 239 of Perl/Critic/Command.pm
sub policies {
6514546┬Ás my $self = shift;
66
67 #Delegate to Perl::Critic::Config
681451.06ms290794┬Ás return $self->config()->policies();
# spent 430┬Ás making 145 calls to Perl::Critic::Config::policies, avg 3┬Ás/call # spent 364┬Ás making 145 calls to Perl::Critic::config, avg 3┬Ás/call
69}
70
71#-----------------------------------------------------------------------------
72
73
# spent 419┬Ás within Perl::Critic::statistics which was called 144 times, avg 3┬Ás/call: # 144 times (419┬Ás+0s) by Perl::Critic::_gather_violations at line 138, avg 3┬Ás/call
sub statistics {
7414476┬Ás my $self = shift;
75144425┬Ás return $self->{_stats};
76}
77
78#-----------------------------------------------------------------------------
79
80
# spent 32.4s (22.6ms+32.4) within Perl::Critic::critique which was called 144 times, avg 225ms/call: # 144 times (22.6ms+32.4s) by Perl::Critic::Command::_critique at line 249 of Perl/Critic/Command.pm, avg 225ms/call
sub critique { ## no critic (ArgUnpacking)
81
82 #-------------------------------------------------------------------
83 # This subroutine can be called as an object method or as a static
84 # function. In the latter case, the first argument can be a
85 # hashref of configuration parameters that shall be used to create
86 # an object behind the scenes. Note that this object does not
87 # persist. In other words, it is not a singleton. Here are some
88 # of the ways this subroutine might get called:
89 #
90 # #Object style...
91 # $critic->critique( $code );
92 #
93 # #Functional style...
94 # critique( $code );
95 # critique( {}, $code );
96 # critique( {-foo => bar}, $code );
97 #------------------------------------------------------------------
98
99144226┬Ás my ( $self, $source_code ) = @_ >= 2 ? @_ : ( {}, $_[0] );
100144180┬Ás $self = ref $self eq 'HASH' ? __PACKAGE__->new(%{ $self }) : $self;
10114436┬Ás return if not defined $source_code; # If no code, then nothing to do.
102
103144344┬Ás144366┬Ás my $config = $self->config();
# spent 366┬Ás making 144 calls to Perl::Critic::config, avg 3┬Ás/call
1041442.10ms43216.5s my $doc =
# spent 16.5s making 144 calls to Perl::Critic::Document::new, avg 115ms/call # spent 549┬Ás making 144 calls to Perl::Critic::Config::program_extensions_as_regexes, avg 4┬Ás/call # spent 212┬Ás making 144 calls to Scalar::Util::blessed, avg 1┬Ás/call
105 blessed($source_code) && $source_code->isa('Perl::Critic::Document')
106 ? $source_code
107 : Perl::Critic::Document->new(
108 '-source' => $source_code,
109 '-program-extensions' => [$config->program_extensions_as_regexes()],
110 );
111
112144417┬Ás1442.10ms if ( 0 == $self->policies() ) {
# spent 2.10ms making 144 calls to Perl::Critic::policies, avg 15┬Ás/call
113 Perl::Critic::Exception::Configuration::Generic->throw(
114 message => 'There are no enabled policies.',
115 )
116 }
117
11814416.1ms14414.9s return $self->_gather_violations($doc);
# spent 14.9s making 144 calls to Perl::Critic::_gather_violations, avg 103ms/call
119}
120
121#=============================================================================
122# PRIVATE methods
123
124
# spent 14.9s (16.9ms+14.9) within Perl::Critic::_gather_violations which was called 144 times, avg 103ms/call: # 144 times (16.9ms+14.9s) by Perl::Critic::critique at line 118, avg 103ms/call
sub _gather_violations {
12514462┬Ás my ($self, $doc) = @_;
126
127 # Disable exempt code lines, if desired
1281443.68ms4321.78s if ( not $self->config->force() ) {
# spent 1.78s making 144 calls to Perl::Critic::Document::process_annotations, avg 12.4ms/call # spent 342┬Ás making 144 calls to Perl::Critic::Config::force, avg 2┬Ás/call # spent 167┬Ás making 144 calls to Perl::Critic::config, avg 1┬Ás/call
129 $doc->process_annotations();
130 }
131
132 # Evaluate each policy
133144796┬Ás288957┬Ás my @policies = $self->config->policies();
# spent 643┬Ás making 144 calls to Perl::Critic::Config::policies, avg 4┬Ás/call # spent 315┬Ás making 144 calls to Perl::Critic::config, avg 2┬Ás/call
134144482┬Ás1444.52ms my @ordered_policies = _futz_with_policy_order(@policies);
# spent 4.52ms making 144 calls to Perl::Critic::_futz_with_policy_order, avg 31┬Ás/call
13531684.75ms30247.77s my @violations = map { _critique($_, $doc) } @ordered_policies;
# spent 7.77s making 3024 calls to Perl::Critic::_critique, avg 2.57ms/call
136
137 # Accumulate statistics
138144773┬Ás2885.32s $self->statistics->accumulate( $doc, \@violations );
# spent 5.32s making 144 calls to Perl::Critic::Statistics::accumulate, avg 36.9ms/call # spent 419┬Ás making 144 calls to Perl::Critic::statistics, avg 3┬Ás/call
139
140 # If requested, rank violations by their severity and return the top N.
14114472┬Ás if ( @violations && (my $top = $self->config->top()) ) {
142 my $limit = @violations < $top ? $#violations : $top-1;
143 @violations = Perl::Critic::Violation::sort_by_severity(@violations);
144 @violations = ( reverse @violations )[ 0 .. $limit ]; #Slicing...
145 }
146
147 # Always return violations sorted by location
1481441.88ms1441.07ms return Perl::Critic::Violation->sort_by_location(@violations);
# spent 1.07ms making 144 calls to Perl::Critic::Violation::sort_by_location, avg 7┬Ás/call
149}
150
151#=============================================================================
152# PRIVATE functions
153
154
# spent 7.77s (639ms+7.14) within Perl::Critic::_critique which was called 3024 times, avg 2.57ms/call: # 3024 times (639ms+7.14s) by Perl::Critic::_gather_violations at line 135, avg 2.57ms/call
sub _critique {
1553024948┬Ás my ($policy, $doc) = @_;
156
157302411.1ms57601.45s return if not $policy->prepare_to_scan_document($doc);
# spent 1.43s making 144 calls to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::prepare_to_scan_document, avg 9.92ms/call # spent 16.4ms making 2736 calls to Perl::Critic::Policy::prepare_to_scan_document, avg 6┬Ás/call # spent 4.22ms making 2736 calls to Readonly::Scalar::FETCH, avg 2┬Ás/call # spent 1.12ms making 144 calls to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::prepare_to_scan_document, avg 8┬Ás/call
158
15930244.79ms302420.7ms my $maximum_violations = $policy->get_maximum_violations_per_document();
# spent 20.7ms making 3024 calls to Perl::Critic::Policy::get_maximum_violations_per_document, avg 7┬Ás/call
1603024500┬Ás return if defined $maximum_violations && $maximum_violations == 0;
161
1623024817┬Ás my @violations = ();
163
164 TYPE:
16530247.33ms30245.99ms for my $type ( $policy->applies_to() ) {
# spent 330┬Ás making 144 calls to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict::applies_to, avg 2┬Ás/call # spent 320┬Ás making 144 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::applies_to, avg 2┬Ás/call # spent 309┬Ás making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::applies_to, avg 2┬Ás/call # spent 305┬Ás making 144 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::applies_to, avg 2┬Ás/call # spent 303┬Ás making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::applies_to, avg 2┬Ás/call # spent 298┬Ás making 144 calls to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::applies_to, avg 2┬Ás/call # spent 291┬Ás making 144 calls to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::applies_to, avg 2┬Ás/call # spent 290┬Ás making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::applies_to, avg 2┬Ás/call # spent 284┬Ás making 144 calls to Perl::Critic::Policy::ValuesAndExpressions::ProhibitLeadingZeros::applies_to, avg 2┬Ás/call # spent 283┬Ás making 144 calls to Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::applies_to, avg 2┬Ás/call # spent 282┬Ás making 144 calls to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::applies_to, avg 2┬Ás/call # spent 281┬Ás making 144 calls to Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::applies_to, avg 2┬Ás/call # spent 280┬Ás making 144 calls to Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless::applies_to, avg 2┬Ás/call # spent 276┬Ás making 144 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::applies_to, avg 2┬Ás/call # spent 276┬Ás making 144 calls to Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::applies_to, avg 2┬Ás/call # spent 272┬Ás making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes::applies_to, avg 2┬Ás/call # spent 267┬Ás making 144 calls to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::applies_to, avg 2┬Ás/call # spent 263┬Ás making 144 calls to Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest::applies_to, avg 2┬Ás/call # spent 262┬Ás making 144 calls to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::applies_to, avg 2┬Ás/call # spent 259┬Ás making 144 calls to Perl::Critic::Policy::Modules::RequireBarewordIncludes::applies_to, avg 2┬Ás/call # spent 258┬Ás making 144 calls to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::applies_to, avg 2┬Ás/call
1663024316┬Ás my @elements;
16730241.36ms if ($type eq 'PPI::Document') {
168 @elements = ($doc);
169 }
170 else {
171273612.3ms273617.3ms @elements = @{ $doc->find($type) || [] };
# spent 17.3ms making 2736 calls to Perl::Critic::Document::find, avg 6┬Ás/call
172 }
173
174 ELEMENT:
17530245.54ms for my $element (@elements) {
176
177 # Evaluate the policy on this $element. A policy may
178 # return zero or more violations. We only want the
179 # violations that occur on lines that have not been
180 # disabled.
181
182 VIOLATION:
183136782272ms1367825.65s for my $violation ( $policy->violates( $element, $doc ) ) {
# spent 1.34s making 1016 calls to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::violates, avg 1.32ms/call # spent 630ms making 13481 calls to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::violates, avg 47┬Ás/call # spent 620ms making 13481 calls to Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::violates, avg 46┬Ás/call # spent 431ms making 144 calls to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::violates, avg 3.00ms/call # spent 413ms making 13481 calls to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::violates, avg 31┬Ás/call # spent 322ms making 13481 calls to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::violates, avg 24┬Ás/call # spent 315ms making 13481 calls to Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless::violates, avg 23┬Ás/call # spent 305ms making 13481 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::violates, avg 23┬Ás/call # spent 293ms making 13481 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::violates, avg 22┬Ás/call # spent 277ms making 1299 calls to Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::violates, avg 213┬Ás/call # spent 195ms making 8379 calls to Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest::violates, avg 23┬Ás/call # spent 167ms making 13481 calls to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::violates, avg 12┬Ás/call # spent 151ms making 13481 calls to Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::violates, avg 11┬Ás/call # spent 51.3ms making 1016 calls to Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes::violates, avg 50┬Ás/call # spent 37.1ms making 982 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::violates, avg 38┬Ás/call # spent 33.5ms making 504 calls to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::violates, avg 66┬Ás/call # spent 27.1ms making 144 calls to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::violates, avg 188┬Ás/call # spent 20.9ms making 982 calls to Perl::Critic::Policy::Modules::RequireBarewordIncludes::violates, avg 21┬Ás/call # spent 20.3ms making 982 calls to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict::violates, avg 21┬Ás/call # spent 104┬Ás making 5 calls to Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::violates, avg 21┬Ás/call
184
18536┬Ás36┬Ás my $line = $violation->location()->[0];
# spent 6┬Ás making 3 calls to Perl::Critic::Violation::location, avg 2┬Ás/call
18635┬Ás312┬Ás if ( $doc->line_is_disabled_for_policy($line, $policy) ) {
# spent 12┬Ás making 3 calls to Perl::Critic::Document::line_is_disabled_for_policy, avg 4┬Ás/call
18735┬Ás38┬Ás $doc->add_suppressed_violation($violation);
# spent 8┬Ás making 3 calls to Perl::Critic::Document::add_suppressed_violation, avg 3┬Ás/call
18832┬Ás next VIOLATION;
189 }
190
191 push @violations, $violation;
192 last TYPE if defined $maximum_violations and @violations >= $maximum_violations;
193 }
194 }
195 }
196
19730246.52ms return @violations;
198}
199
200#-----------------------------------------------------------------------------
201
202
# spent 4.52ms (1.74+2.77) within Perl::Critic::_futz_with_policy_order which was called 144 times, avg 31┬Ás/call: # 144 times (1.74ms+2.77ms) by Perl::Critic::_gather_violations at line 134, avg 31┬Ás/call
sub _futz_with_policy_order {
203 # The ProhibitUselessNoCritic policy is another special policy. It
204 # deals with the violations that *other* Policies produce. Therefore
205 # it needs to be run *after* all the other Policies. TODO: find
206 # a way for Policies to express an ordering preference somehow.
207
208144165┬Ás my @policy_objects = @_;
20914472┬Ás my $magical_policy_name = 'Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic';
21031683.16ms1442.77ms my $idx = firstidx {ref $_ eq $magical_policy_name} @policy_objects;
# spent 2.77ms making 144 calls to List::MoreUtils::firstidx, avg 19┬Ás/call
211144165┬Ás push @policy_objects, splice @policy_objects, $idx, 1;
212144552┬Ás return @policy_objects;
213}
214
215#-----------------------------------------------------------------------------
216
21714┬Ás1;
218
- -
221__END__