← 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/Policy.pm
StatementsExecuted 22658 statements in 76.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
30241117.8ms20.7msPerl::Critic::Policy::::get_maximum_violations_per_documentPerl::Critic::Policy::get_maximum_violations_per_document
1411117.6ms227msPerl::Critic::Policy::::newPerl::Critic::Policy::new
27361112.2ms16.4msPerl::Critic::Policy::::prepare_to_scan_documentPerl::Critic::Policy::prepare_to_scan_document
1411110.8ms102msPerl::Critic::Policy::::__set_base_parametersPerl::Critic::Policy::__set_base_parameters
4454310.2ms40.6msPerl::Critic::Policy::::to_stringPerl::Critic::Policy::to_string
282225.64ms5.64msPerl::Critic::Policy::::__set_configPerl::Critic::Policy::__set_config
141115.32ms7.91msPerl::Critic::Policy::::_set_maximum_violations_per_documentPerl::Critic::Policy::_set_maximum_violations_per_document
2880112.56ms2.56msPerl::Critic::Policy::::default_maximum_violations_per_documentPerl::Critic::Policy::default_maximum_violations_per_document
586211.76ms11.8msPerl::Critic::Policy::::get_short_namePerl::Critic::Policy::get_short_name
144221.52ms2.63msPerl::Critic::Policy::::get_severityPerl::Critic::Policy::get_severity
445111.47ms11.2msPerl::Critic::Policy::::__ANON__[:467]Perl::Critic::Policy::__ANON__[:467]
1111.15ms7.57msPerl::Critic::Policy::::BEGIN@45Perl::Critic::Policy::BEGIN@45
14111553┬Ás760┬ÁsPerl::Critic::Policy::::is_safePerl::Critic::Policy::is_safe
44511535┬Ás535┬ÁsPerl::Critic::Policy::::get_formatPerl::Critic::Policy::get_format
8787462┬Ás882┬ÁsPerl::Critic::Policy::::__set_parameter_valuePerl::Critic::Policy::__set_parameter_value
30432409┬Ás409┬ÁsPerl::Critic::Policy::::__get_configPerl::Critic::Policy::__get_config
8711313┬Ás420┬ÁsPerl::Critic::Policy::::__get_parameter_namePerl::Critic::Policy::__get_parameter_name
111286┬Ás725┬ÁsPerl::Critic::Policy::::BEGIN@33Perl::Critic::Policy::BEGIN@33
2221111┬Ás139┬ÁsPerl::Critic::Policy::::__set_enabledPerl::Critic::Policy::__set_enabled
191178┬Ás106┬ÁsPerl::Critic::Policy::::initialize_if_enabledPerl::Critic::Policy::initialize_if_enabled
31147┬Ás85┬ÁsPerl::Critic::Policy::::violationPerl::Critic::Policy::violation
11117┬Ás17┬ÁsPerl::Critic::Policy::::BEGIN@10Perl::Critic::Policy::BEGIN@10
11110┬Ás20┬ÁsPerl::Critic::Policy::::BEGIN@40Perl::Critic::Policy::BEGIN@40
1119┬Ás19┬ÁsPerl::Critic::Policy::::BEGIN@39Perl::Critic::Policy::BEGIN@39
1119┬Ás19┬ÁsPerl::Critic::Policy::::BEGIN@38Perl::Critic::Policy::BEGIN@38
1118┬Ás19┬ÁsPerl::Critic::Policy::::BEGIN@41Perl::Critic::Policy::BEGIN@41
1118┬Ás19┬ÁsPerl::Critic::Policy::::BEGIN@48Perl::Critic::Policy::BEGIN@48
1118┬Ás31┬ÁsPerl::Critic::Policy::::BEGIN@34Perl::Critic::Policy::BEGIN@34
1118┬Ás30┬ÁsPerl::Critic::Policy::::BEGIN@18Perl::Critic::Policy::BEGIN@18
1118┬Ás25┬ÁsPerl::Critic::Policy::::BEGIN@43Perl::Critic::Policy::BEGIN@43
1118┬Ás362┬ÁsPerl::Critic::Policy::::BEGIN@14Perl::Critic::Policy::BEGIN@14
1117┬Ás34┬ÁsPerl::Critic::Policy::::BEGIN@20Perl::Critic::Policy::BEGIN@20
1117┬Ás26┬ÁsPerl::Critic::Policy::::BEGIN@15Perl::Critic::Policy::BEGIN@15
1117┬Ás496┬ÁsPerl::Critic::Policy::::BEGIN@22Perl::Critic::Policy::BEGIN@22
1116┬Ás10┬ÁsPerl::Critic::Policy::::BEGIN@12Perl::Critic::Policy::BEGIN@12
1116┬Ás17┬ÁsPerl::Critic::Policy::::BEGIN@11Perl::Critic::Policy::BEGIN@11
1114┬Ás4┬ÁsPerl::Critic::Policy::::BEGIN@46Perl::Critic::Policy::BEGIN@46
1113┬Ás3┬ÁsPerl::Critic::Policy::::BEGIN@17Perl::Critic::Policy::BEGIN@17
1113┬Ás3┬ÁsPerl::Critic::Policy::::BEGIN@44Perl::Critic::Policy::BEGIN@44
0000s0sPerl::Critic::Policy::::__ANON__[:466]Perl::Critic::Policy::__ANON__[:466]
0000s0sPerl::Critic::Policy::::__ANON__[:468]Perl::Critic::Policy::__ANON__[:468]
0000s0sPerl::Critic::Policy::::__ANON__[:469]Perl::Critic::Policy::__ANON__[:469]
0000s0sPerl::Critic::Policy::::__ANON__[:470]Perl::Critic::Policy::__ANON__[:470]
0000s0sPerl::Critic::Policy::::__ANON__[:471]Perl::Critic::Policy::__ANON__[:471]
0000s0sPerl::Critic::Policy::::__ANON__[:472]Perl::Critic::Policy::__ANON__[:472]
0000s0sPerl::Critic::Policy::::__ANON__[:473]Perl::Critic::Policy::__ANON__[:473]
0000s0sPerl::Critic::Policy::::__ANON__[:474]Perl::Critic::Policy::__ANON__[:474]
0000s0sPerl::Critic::Policy::::__ANON__[:475]Perl::Critic::Policy::__ANON__[:475]
0000s0sPerl::Critic::Policy::::__ANON__[:476]Perl::Critic::Policy::__ANON__[:476]
0000s0sPerl::Critic::Policy::::_comparePerl::Critic::Policy::_compare
0000s0sPerl::Critic::Policy::::_format_lack_of_parameter_metadataPerl::Critic::Policy::_format_lack_of_parameter_metadata
0000s0sPerl::Critic::Policy::::_format_parametersPerl::Critic::Policy::_format_parameters
0000s0sPerl::Critic::Policy::::add_themesPerl::Critic::Policy::add_themes
0000s0sPerl::Critic::Policy::::applies_toPerl::Critic::Policy::applies_to
0000s0sPerl::Critic::Policy::::default_severityPerl::Critic::Policy::default_severity
0000s0sPerl::Critic::Policy::::default_themesPerl::Critic::Policy::default_themes
0000s0sPerl::Critic::Policy::::get_abstractPerl::Critic::Policy::get_abstract
0000s0sPerl::Critic::Policy::::get_long_namePerl::Critic::Policy::get_long_name
0000s0sPerl::Critic::Policy::::get_parametersPerl::Critic::Policy::get_parameters
0000s0sPerl::Critic::Policy::::get_raw_abstractPerl::Critic::Policy::get_raw_abstract
0000s0sPerl::Critic::Policy::::get_themesPerl::Critic::Policy::get_themes
0000s0sPerl::Critic::Policy::::is_enabledPerl::Critic::Policy::is_enabled
0000s0sPerl::Critic::Policy::::new_parameter_value_exceptionPerl::Critic::Policy::new_parameter_value_exception
0000s0sPerl::Critic::Policy::::parameter_metadata_availablePerl::Critic::Policy::parameter_metadata_available
0000s0sPerl::Critic::Policy::::set_formatPerl::Critic::Policy::set_format
0000s0sPerl::Critic::Policy::::set_maximum_violations_per_documentPerl::Critic::Policy::set_maximum_violations_per_document
0000s0sPerl::Critic::Policy::::set_severityPerl::Critic::Policy::set_severity
0000s0sPerl::Critic::Policy::::set_themesPerl::Critic::Policy::set_themes
0000s0sPerl::Critic::Policy::::throw_parameter_value_exceptionPerl::Critic::Policy::throw_parameter_value_exception
0000s0sPerl::Critic::Policy::::violatesPerl::Critic::Policy::violates
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::Policy;
9
10236┬Ás117┬Ás
# spent 17┬Ás within Perl::Critic::Policy::BEGIN@10 which was called: # once (17┬Ás+0s) by base::import at line 10
use 5.006001;
# spent 17┬Ás making 1 call to Perl::Critic::Policy::BEGIN@10
11218┬Ás228┬Ás
# spent 17┬Ás (6+11) within Perl::Critic::Policy::BEGIN@11 which was called: # once (6┬Ás+11┬Ás) by base::import at line 11
use strict;
# spent 17┬Ás making 1 call to Perl::Critic::Policy::BEGIN@11 # spent 11┬Ás making 1 call to strict::import
12219┬Ás214┬Ás
# spent 10┬Ás (6+4) within Perl::Critic::Policy::BEGIN@12 which was called: # once (6┬Ás+4┬Ás) by base::import at line 12
use warnings;
# spent 10┬Ás making 1 call to Perl::Critic::Policy::BEGIN@12 # spent 4┬Ás making 1 call to warnings::import
13
14222┬Ás2716┬Ás
# spent 362┬Ás (8+354) within Perl::Critic::Policy::BEGIN@14 which was called: # once (8┬Ás+354┬Ás) by base::import at line 14
use English qw< -no_match_vars >;
# spent 362┬Ás making 1 call to Perl::Critic::Policy::BEGIN@14 # spent 354┬Ás making 1 call to English::import
15218┬Ás244┬Ás
# spent 26┬Ás (7+19) within Perl::Critic::Policy::BEGIN@15 which was called: # once (7┬Ás+19┬Ás) by base::import at line 15
use Readonly;
# spent 26┬Ás making 1 call to Perl::Critic::Policy::BEGIN@15 # spent 19┬Ás making 1 call to Exporter::import
16
17218┬Ás13┬Ás
# spent 3┬Ás within Perl::Critic::Policy::BEGIN@17 which was called: # once (3┬Ás+0s) by base::import at line 17
use File::Spec ();
# spent 3┬Ás making 1 call to Perl::Critic::Policy::BEGIN@17
18224┬Ás252┬Ás
# spent 30┬Ás (8+22) within Perl::Critic::Policy::BEGIN@18 which was called: # once (8┬Ás+22┬Ás) by base::import at line 18
use String::Format qw< stringf >;
# spent 30┬Ás making 1 call to Perl::Critic::Policy::BEGIN@18 # spent 22┬Ás making 1 call to Exporter::import
19
20228┬Ás262┬Ás
# spent 34┬Ás (7+27) within Perl::Critic::Policy::BEGIN@20 which was called: # once (7┬Ás+27┬Ás) by base::import at line 20
use overload ( q<""> => 'to_string', cmp => '_compare' );
# spent 34┬Ás making 1 call to Perl::Critic::Policy::BEGIN@20 # spent 27┬Ás making 1 call to overload::import
21
221300ns
# spent 496┬Ás (7+490) within Perl::Critic::Policy::BEGIN@22 which was called: # once (7┬Ás+490┬Ás) by base::import at line 32
use Perl::Critic::Utils qw<
23 :characters
24 :booleans
25 :severities
26 :data_conversion
27 interpolate
28 is_integer
29 policy_long_name
30 policy_short_name
31 severity_to_number
32126┬Ás2986┬Ás>;
# spent 496┬Ás making 1 call to Perl::Critic::Policy::BEGIN@22 # spent 490┬Ás making 1 call to Exporter::import
33290┬Ás2774┬Ás
# spent 725┬Ás (286+440) within Perl::Critic::Policy::BEGIN@33 which was called: # once (286┬Ás+440┬Ás) by base::import at line 33
use Perl::Critic::Utils::DataConversion qw< dor >;
# spent 725┬Ás making 1 call to Perl::Critic::Policy::BEGIN@33 # spent 49┬Ás making 1 call to Exporter::import
341400ns
# spent 31┬Ás (8+23) within Perl::Critic::Policy::BEGIN@34 which was called: # once (8┬Ás+23┬Ás) by base::import at line 37
use Perl::Critic::Utils::POD qw<
35 get_module_abstract_for_module
36 get_raw_module_abstract_for_module
37120┬Ás254┬Ás>;
# spent 31┬Ás making 1 call to Perl::Critic::Policy::BEGIN@34 # spent 23┬Ás making 1 call to Exporter::import
38223┬Ás229┬Ás
# spent 19┬Ás (9+10) within Perl::Critic::Policy::BEGIN@38 which was called: # once (9┬Ás+10┬Ás) by base::import at line 38
use Perl::Critic::Exception::AggregateConfiguration;
# spent 19┬Ás making 1 call to Perl::Critic::Policy::BEGIN@38 # spent 10┬Ás making 1 call to Exporter::import
39219┬Ás229┬Ás
# spent 19┬Ás (9+10) within Perl::Critic::Policy::BEGIN@39 which was called: # once (9┬Ás+10┬Ás) by base::import at line 39
use Perl::Critic::Exception::Configuration;
# spent 19┬Ás making 1 call to Perl::Critic::Policy::BEGIN@39 # spent 10┬Ás making 1 call to Exporter::import
40219┬Ás231┬Ás
# spent 20┬Ás (10+11) within Perl::Critic::Policy::BEGIN@40 which was called: # once (10┬Ás+11┬Ás) by base::import at line 40
use Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter;
# spent 20┬Ás making 1 call to Perl::Critic::Policy::BEGIN@40 # spent 11┬Ás making 1 call to Exporter::import
41221┬Ás230┬Ás
# spent 19┬Ás (8+11) within Perl::Critic::Policy::BEGIN@41 which was called: # once (8┬Ás+11┬Ás) by base::import at line 41
use Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue;
# spent 19┬Ás making 1 call to Perl::Critic::Policy::BEGIN@41 # spent 10┬Ás making 1 call to Exporter::import
42use Perl::Critic::Exception::Fatal::PolicyDefinition
43220┬Ás242┬Ás
# spent 25┬Ás (8+17) within Perl::Critic::Policy::BEGIN@43 which was called: # once (8┬Ás+17┬Ás) by base::import at line 43
qw< throw_policy_definition >;
# spent 25┬Ás making 1 call to Perl::Critic::Policy::BEGIN@43 # spent 17┬Ás making 1 call to Exporter::import
44216┬Ás13┬Ás
# spent 3┬Ás within Perl::Critic::Policy::BEGIN@44 which was called: # once (3┬Ás+0s) by base::import at line 44
use Perl::Critic::PolicyConfig qw<>;
# spent 3┬Ás making 1 call to Perl::Critic::Policy::BEGIN@44
45286┬Ás17.57ms
# spent 7.57ms (1.15+6.42) within Perl::Critic::Policy::BEGIN@45 which was called: # once (1.15ms+6.42ms) by base::import at line 45
use Perl::Critic::PolicyParameter qw<>;
# spent 7.57ms making 1 call to Perl::Critic::Policy::BEGIN@45
46218┬Ás14┬Ás
# spent 4┬Ás within Perl::Critic::Policy::BEGIN@46 which was called: # once (4┬Ás+0s) by base::import at line 46
use Perl::Critic::Violation qw<>;
# spent 4┬Ás making 1 call to Perl::Critic::Policy::BEGIN@46
47
4821.44ms229┬Ás
# spent 19┬Ás (8+10) within Perl::Critic::Policy::BEGIN@48 which was called: # once (8┬Ás+10┬Ás) by base::import at line 48
use Exception::Class; # this must come after "use P::C::Exception::*"
# spent 19┬Ás making 1 call to Perl::Critic::Policy::BEGIN@48 # spent 10┬Ás making 1 call to Exception::Class::import
49
501600nsour $VERSION = '1.121';
51
52#-----------------------------------------------------------------------------
53
5412┬Ás132┬ÁsReadonly::Scalar my $NO_LIMIT => 'no_limit';
# spent 32┬Ás making 1 call to Readonly::Scalar
55
56#-----------------------------------------------------------------------------
57
581300nsmy $format = "%p\n"; #Default stringy format
59
60#-----------------------------------------------------------------------------
61
62
# spent 227ms (17.6+209) within Perl::Critic::Policy::new which was called 141 times, avg 1.61ms/call: # 141 times (17.6ms+209ms) by Perl::Critic::PolicyFactory::_instantiate_policy at line 260 of Perl/Critic/PolicyFactory.pm, avg 1.61ms/call
sub new {
6314188┬Ás my ($class, %config) = @_;
64
65141162┬Ás my $self = bless {}, $class;
66
6714114┬Ás my $config_object;
6814165┬Ás if ($config{_config_object}) {
69 $config_object = $config{_config_object};
70 }
71 else {
72141561┬Ás2824.32ms $config_object =
# spent 2.21ms making 141 calls to Perl::Critic::PolicyConfig::new, avg 16┬Ás/call # spent 2.10ms making 141 calls to Perl::Critic::Policy::get_short_name, avg 15┬Ás/call
73 Perl::Critic::PolicyConfig->new(
74 $self->get_short_name(),
75 \%config,
76 );
77 }
78
79141396┬Ás1415.19ms $self->__set_config( $config_object );
# spent 5.19ms making 141 calls to Perl::Critic::Policy::__set_config, avg 37┬Ás/call
80
8114116┬Ás my @parameters;
8214137┬Ás my $parameter_metadata_available = 0;
83
84141967┬Ás141293┬Ás if ( $class->can('supported_parameters') ) {
# spent 293┬Ás making 141 calls to UNIVERSAL::can, avg 2┬Ás/call
8514116┬Ás $parameter_metadata_available = 1;
8697132┬Ás974.70ms @parameters =
# spent 4.70ms making 97 calls to Perl::Critic::PolicyParameter::new, avg 48┬Ás/call
87 map
88141419┬Ás1411.28ms { Perl::Critic::PolicyParameter->new($_) }
# spent 154┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters::supported_parameters # spent 103┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::supported_parameters # spent 78┬Ás making 1 call to Perl::Critic::Policy::NamingConventions::Capitalization::supported_parameters # spent 76┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePodSections::supported_parameters # spent 67┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls::supported_parameters # spent 49┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireCheckedSyscalls::supported_parameters # spent 29┬Ás making 1 call to Perl::Critic::Policy::Documentation::PodSpelling::supported_parameters # spent 26┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::supported_parameters # spent 25┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitEvilVariables::supported_parameters # spent 25┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProtectPrivateSubs::supported_parameters # spent 22┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitInterpolationOfLiterals::supported_parameters # spent 22┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitPunctuationVars::supported_parameters # spent 19┬Ás making 1 call to Perl::Critic::Policy::Subroutines::RequireArgUnpacking::supported_parameters # spent 19┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitComplexVersion::supported_parameters # spent 19┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoWarnings::supported_parameters # spent 18┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireConstantVersion::supported_parameters # spent 18┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars::supported_parameters # spent 18┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitUnusedPrivateSubroutines::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::RequireTestLabels::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::Subroutines::RequireFinalReturn::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitPackageVars::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames::supported_parameters # spent 16┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireLocalizedPunctuationVars::supported_parameters # spent 15┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::RequireUseWarnings::supported_parameters # spent 15┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers::supported_parameters # spent 11┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireCheckedClose::supported_parameters # spent 9┬Ás making 1 call to Perl::Critic::Policy::ErrorHandling::RequireCarping::supported_parameters # spent 8┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePodLinksIncludeText::supported_parameters # spent 8┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting::supported_parameters # spent 8┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitHardTabs::supported_parameters # spent 8┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitQuotedWordLists::supported_parameters # spent 7┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireExplicitPackage::supported_parameters # spent 6┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity::supported_parameters # spent 6┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitCaptureWithoutTest::supported_parameters # spent 6┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitComplexRegexes::supported_parameters # spent 6┬Ás making 1 call to Perl::Critic::Policy::Objects::ProhibitIndirectSyntax::supported_parameters # spent 6┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitLeadingZeros::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitExcessMainComplexity::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitCascadingIfElse::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitLongChainsOfMethodCalls::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireBriefOpen::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitDeepNests::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitReusedNames::supported_parameters # spent 5┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::RequireTidyCode::supported_parameters # spent 4┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireBracesForMultiline::supported_parameters # spent 4┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitManyArgs::supported_parameters # spent 3┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitAmpersandSigils::supported_parameters # spent 3┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines::supported_parameters # spent 3┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitVersionStrings::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockMap::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePackageMatchesPodName::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitExplicitStdin::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireEndWithOne::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitJoinedReadline::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitEnumeratedClasses::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ClassHierarchies::ProhibitAutoloading::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ClassHierarchies::ProhibitExplicitISA::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitOneArgSelect::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitSingleCharAlternation::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitFormats::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireBarewordIncludes::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireNoMatchVarsWithUseEnglish::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitEscapedMetacharacters::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireDotMatchAnything::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireUpperCaseHeredocTerminator::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitAugmentedAssignmentInDeclaration::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitLocalVars::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitUnusedVariables::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringySplit::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidMap::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitTrailingWhitespace::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::RequireConsistentNewlines::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ErrorHandling::RequireCheckingReturnValueOfEval::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitAutomaticExportation::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyQuotes::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireQuotedHeredocTerminator::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitMatchVars::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireSimpleSortBlock::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireBracedFileHandleWithPrint::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireCheckedOpen::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUnrestrictedNoCritic::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitConditionalUseStatements::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitEmptyQuotes::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitMismatchedOperators::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitPerl4PackageNames::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireInitializationForLocalVars::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitLvalueSubstr::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalIsa::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::RequireTrailingCommas::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireVersionVar::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::References::ProhibitDoubleSigils::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitFixedStringMatches::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitReverseSortBlock::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidGrep::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::supported_parameters # spent 2┬Ás making 1 call to Perl::Critic::Policy::Variables::ProtectPrivateVars::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitBooleanGrep::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalCan::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitTies::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitMultiplePackages::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireNegativeIndices::supported_parameters # spent 1┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitUntilBlocks::supported_parameters
89 $class->supported_parameters();
90 }
9114167┬Ás $self->{_parameter_metadata_available} = $parameter_metadata_available;
9214148┬Ás $self->{_parameters} = \@parameters;
93
94141242┬Ás14187.0ms my $errors = Perl::Critic::Exception::AggregateConfiguration->new();
# spent 87.0ms making 141 calls to Perl::Critic::Exception::AggregateConfiguration::new, avg 617┬Ás/call
9514183┬Ás foreach my $parameter ( @parameters ) {
96 eval {
9797140┬Ás973.94ms $parameter->parse_and_validate_config_value( $self, $config_object );
# spent 3.94ms making 97 calls to Perl::Critic::PolicyParameter::parse_and_validate_config_value, avg 41┬Ás/call
98 }
999737┬Ás or do {
10097107┬Ás97119┬Ás $errors->add_exception_or_rethrow($EVAL_ERROR);
# spent 119┬Ás making 97 calls to Perl::Critic::Exception::AggregateConfiguration::add_exception_or_rethrow, avg 1┬Ás/call
101 };
102
10397239┬Ás194745┬Ás $config_object->remove( $parameter->get_name() );
# spent 614┬Ás making 97 calls to Perl::Critic::PolicyConfig::remove, avg 6┬Ás/call # spent 132┬Ás making 97 calls to Perl::Critic::PolicyParameter::get_name, avg 1┬Ás/call
104 }
105
106141203┬Ás141101ms if ($parameter_metadata_available) {
# spent 101ms making 141 calls to Perl::Critic::PolicyConfig::handle_extra_parameters, avg 716┬Ás/call
107 $config_object->handle_extra_parameters( $self, $errors );
108 }
109
110141180┬Ás141680┬Ás if ( $errors->has_exceptions() ) {
# spent 680┬Ás making 141 calls to Perl::Critic::Exception::AggregateConfiguration::has_exceptions, avg 5┬Ás/call
111 $errors->rethrow();
112 }
113
1141414.86ms return $self;
115}
116
117#-----------------------------------------------------------------------------
118
119
# spent 760┬Ás (553+207) within Perl::Critic::Policy::is_safe which was called 141 times, avg 5┬Ás/call: # 141 times (553┬Ás+207┬Ás) by Perl::Critic::Config::_load_policies at line 234 of Perl/Critic/Config.pm, avg 5┬Ás/call
sub is_safe {
120141234┬Ás return $TRUE;
121}
122
123#-----------------------------------------------------------------------------
124
125
# spent 106┬Ás (78+28) within Perl::Critic::Policy::initialize_if_enabled which was called 19 times, avg 6┬Ás/call: # 19 times (78┬Ás+28┬Ás) by Perl::Critic::Config::_add_policy_if_enabled at line 202 of Perl/Critic/Config.pm, avg 6┬Ás/call
sub initialize_if_enabled {
1261931┬Ás return $TRUE;
127}
128
129#-----------------------------------------------------------------------------
130
131
# spent 16.4ms (12.2+4.22) within Perl::Critic::Policy::prepare_to_scan_document which was called 2736 times, avg 6┬Ás/call: # 2736 times (12.2ms+4.22ms) by Perl::Critic::_critique at line 157 of Perl/Critic.pm, avg 6┬Ás/call
sub prepare_to_scan_document {
13227365.45ms return $TRUE;
133}
134
135#-----------------------------------------------------------------------------
136
137
# spent 420┬Ás (313+106) within Perl::Critic::Policy::__get_parameter_name which was called 87 times, avg 5┬Ás/call: # 87 times (313┬Ás+106┬Ás) by Perl::Critic::Policy::__set_parameter_value at line 148, avg 5┬Ás/call
sub __get_parameter_name {
1388717┬Ás my ( $self, $parameter ) = @_;
139
14087248┬Ás87106┬Ás return '_' . $parameter->get_name();
# spent 106┬Ás making 87 calls to Perl::Critic::PolicyParameter::get_name, avg 1┬Ás/call
141}
142
143#-----------------------------------------------------------------------------
144
145
# spent 882┬Ás (462+420) within Perl::Critic::Policy::__set_parameter_value which was called 87 times, avg 10┬Ás/call: # 32 times (153┬Ás+147┬Ás) 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 57 of Perl/Critic/PolicyParameter/Behavior/StringList.pm, avg 9┬Ás/call # 20 times (122┬Ás+99┬Ás) by Perl::Critic::PolicyParameter::Behavior::Boolean::_parse at line 37 of Perl/Critic/PolicyParameter/Behavior/Boolean.pm, avg 11┬Ás/call # 14 times (86┬Ás+72┬Ás) by Perl::Critic::PolicyParameter::Behavior::Integer::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/Integer.pm:82] at line 80 of Perl/Critic/PolicyParameter/Behavior/Integer.pm, avg 11┬Ás/call # 11 times (51┬Ás+57┬Ás) by Perl::Critic::PolicyParameter::Behavior::String::_parse at line 31 of Perl/Critic/PolicyParameter/Behavior/String.pm, avg 10┬Ás/call # 5 times (24┬Ás+22┬Ás) 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 90 of Perl/Critic/PolicyParameter/Behavior/Enumeration.pm, avg 9┬Ás/call # 3 times (14┬Ás+13┬Ás) 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:127] at line 124 of Perl/Critic/PolicyParameter/Behavior/Enumeration.pm, avg 9┬Ás/call # once (6┬Ás+5┬Ás) by Perl::Critic::Policy::Subroutines::ProhibitUnusedPrivateSubroutines::_parse_private_name_regex at line 75 of Perl/Critic/Policy/Subroutines/ProhibitUnusedPrivateSubroutines.pm # once (6┬Ás+5┬Ás) by Perl::Critic::Policy::Subroutines::ProtectPrivateSubs::_parse_private_name_regex at line 114 of Perl/Critic/Policy/Subroutines/ProtectPrivateSubs.pm
sub __set_parameter_value {
1468725┬Ás my ( $self, $parameter, $value ) = @_;
147
14887252┬Ás87420┬Ás $self->{ $self->__get_parameter_name($parameter) } = $value;
# spent 420┬Ás making 87 calls to Perl::Critic::Policy::__get_parameter_name, avg 5┬Ás/call
149
15087175┬Ás return;
151}
152
153#-----------------------------------------------------------------------------
154
155
# spent 102ms (10.8+91.6) within Perl::Critic::Policy::__set_base_parameters which was called 141 times, avg 726┬Ás/call: # 141 times (10.8ms+91.6ms) by Perl::Critic::PolicyFactory::_instantiate_policy at line 269 of Perl/Critic/PolicyFactory.pm, avg 726┬Ás/call
sub __set_base_parameters {
15614128┬Ás my ($self) = @_;
157
158141342┬Ás141194┬Ás my $config = $self->__get_config();
# spent 194┬Ás making 141 calls to Perl::Critic::Policy::__get_config, avg 1┬Ás/call
159141228┬Ás14179.6ms my $errors = Perl::Critic::Exception::AggregateConfiguration->new();
# spent 79.6ms making 141 calls to Perl::Critic::Exception::AggregateConfiguration::new, avg 565┬Ás/call
160
161141580┬Ás1417.91ms $self->_set_maximum_violations_per_document($errors);
# spent 7.91ms making 141 calls to Perl::Critic::Policy::_set_maximum_violations_per_document, avg 56┬Ás/call
162
163141187┬Ás1411.12ms my $user_severity = $config->get_severity();
# spent 1.12ms making 141 calls to Perl::Critic::PolicyConfig::get_severity, avg 8┬Ás/call
16414115┬Ás if ( defined $user_severity ) {
165 my $normalized_severity = severity_to_number( $user_severity );
166 $self->set_severity( $normalized_severity );
167 }
168
169141178┬Ás1411.07ms my $user_set_themes = $config->get_set_themes();
# spent 1.07ms making 141 calls to Perl::Critic::PolicyConfig::get_set_themes, avg 8┬Ás/call
17014114┬Ás if ( defined $user_set_themes ) {
171 my @set_themes = words_from_string( $user_set_themes );
172 $self->set_themes( @set_themes );
173 }
174
175141174┬Ás1411.03ms my $user_add_themes = $config->get_add_themes();
# spent 1.03ms making 141 calls to Perl::Critic::PolicyConfig::get_add_themes, avg 7┬Ás/call
17614115┬Ás if ( defined $user_add_themes ) {
177 my @add_themes = words_from_string( $user_add_themes );
178 $self->add_themes( @add_themes );
179 }
180
181141156┬Ás141640┬Ás if ( $errors->has_exceptions() ) {
# spent 640┬Ás making 141 calls to Perl::Critic::Exception::AggregateConfiguration::has_exceptions, avg 5┬Ás/call
182 $errors->rethrow();
183 }
184
1851414.85ms return;
186}
187
188#-----------------------------------------------------------------------------
189
190
# spent 7.91ms (5.32+2.59) within Perl::Critic::Policy::_set_maximum_violations_per_document which was called 141 times, avg 56┬Ás/call: # 141 times (5.32ms+2.59ms) by Perl::Critic::Policy::__set_base_parameters at line 161, avg 56┬Ás/call
sub _set_maximum_violations_per_document {
19114130┬Ás my ($self, $errors) = @_;
192
193141139┬Ás141180┬Ás my $config = $self->__get_config();
# spent 180┬Ás making 141 calls to Perl::Critic::Policy::__get_config, avg 1┬Ás/call
194
195141694┬Ás2822.60ms if ( $config->is_maximum_violations_per_document_unlimited() ) {
# spent 2.40ms making 141 calls to Perl::Critic::PolicyConfig::is_maximum_violations_per_document_unlimited, avg 17┬Ás/call # spent 198┬Ás making 141 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
196 return;
197 }
198
199 my $user_maximum_violations =
200 $config->get_maximum_violations_per_document();
201
202 if ( not is_integer($user_maximum_violations) ) {
203 $errors->add_exception(
204 new_parameter_value_exception(
205 'maximum_violations_per_document',
206 $user_maximum_violations,
207 undef,
208 "does not look like an integer.\n"
209 )
210 );
211
212 return;
213 }
214 elsif ( $user_maximum_violations < 0 ) {
215 $errors->add_exception(
216 new_parameter_value_exception(
217 'maximum_violations_per_document',
218 $user_maximum_violations,
219 undef,
220 "is not greater than or equal to zero.\n"
221 )
222 );
223
224 return;
225 }
226
227 $self->set_maximum_violations_per_document(
228 $user_maximum_violations
229 );
230
231 return;
232}
233
234#-----------------------------------------------------------------------------
235
236# Unparsed configuration, P::C::PolicyConfig. Compare with get_parameters().
237
# spent 409┬Ás within Perl::Critic::Policy::__get_config which was called 304 times, avg 1┬Ás/call: # 141 times (194┬Ás+0s) by Perl::Critic::Policy::__set_base_parameters at line 158, avg 1┬Ás/call # 141 times (180┬Ás+0s) by Perl::Critic::Policy::_set_maximum_violations_per_document at line 193, avg 1┬Ás/call # 22 times (34┬Ás+0s) by Perl::Critic::Config::_add_policy_if_enabled at line 196 of Perl/Critic/Config.pm, avg 2┬Ás/call
sub __get_config {
23830436┬Ás my ($self) = @_;
239
2403045.15ms return $self->{_config};
241}
242
243
# spent 5.64ms within Perl::Critic::Policy::__set_config which was called 282 times, avg 20┬Ás/call: # 141 times (5.19ms+0s) by Perl::Critic::Policy::new at line 79, avg 37┬Ás/call # 141 times (447┬Ás+0s) by Perl::Critic::PolicyFactory::_instantiate_policy at line 267 of Perl/Critic/PolicyFactory.pm, avg 3┬Ás/call
sub __set_config {
24428271┬Ás my ($self, $config) = @_;
245
2462825.23ms $self->{_config} = $config;
247
248282540┬Ás return;
249}
250
251 #-----------------------------------------------------------------------------
252
253sub get_long_name {
254 my ($self) = @_;
255
256 return policy_long_name(ref $self);
257}
258
259#-----------------------------------------------------------------------------
260
261
# spent 11.8ms (1.76+10.1) within Perl::Critic::Policy::get_short_name which was called 586 times, avg 20┬Ás/call: # 445 times (1.34ms+8.39ms) by Perl::Critic::Policy::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy.pm:467] at line 467, avg 22┬Ás/call # 141 times (421┬Ás+1.68ms) by Perl::Critic::Policy::new at line 72, avg 15┬Ás/call
sub get_short_name {
262586111┬Ás my ($self) = @_;
263
2645861.63ms58610.1ms return policy_short_name(ref $self);
# spent 10.1ms making 586 calls to Perl::Critic::Utils::policy_short_name, avg 17┬Ás/call
265}
266
267#-----------------------------------------------------------------------------
268
269sub is_enabled {
270 my ($self) = @_;
271
272 return $self->{_enabled};
273}
274
275#-----------------------------------------------------------------------------
276
277
# spent 139┬Ás (111+28) within Perl::Critic::Policy::__set_enabled which was called 22 times, avg 6┬Ás/call: # 21 times (106┬Ás+27┬Ás) by Perl::Critic::Config::_add_policy_if_enabled at line 203 of Perl/Critic/Config.pm, avg 6┬Ás/call # once (5┬Ás+1┬Ás) by Perl::Critic::Config::_add_policy_if_enabled at line 207 of Perl/Critic/Config.pm
sub __set_enabled {
2782239┬Ás2228┬Ás my ($self, $new_value) = @_;
# spent 28┬Ás making 22 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
279
2802213┬Ás $self->{_enabled} = $new_value;
281
2822242┬Ás return;
283}
284
285#-----------------------------------------------------------------------------
286
287sub applies_to {
288 return qw(PPI::Element);
289}
290
291#-----------------------------------------------------------------------------
292
293sub set_maximum_violations_per_document {
294 my ($self, $maximum_violations_per_document) = @_;
295
296 $self->{_maximum_violations_per_document} =
297 $maximum_violations_per_document;
298
299 return $self;
300}
301
302#-----------------------------------------------------------------------------
303
304
# spent 20.7ms (17.8+2.84) within Perl::Critic::Policy::get_maximum_violations_per_document which was called 3024 times, avg 7┬Ás/call: # 3024 times (17.8ms+2.84ms) by Perl::Critic::_critique at line 159 of Perl/Critic.pm, avg 7┬Ás/call
sub get_maximum_violations_per_document {
3053024667┬Ás my ($self) = @_;
306
307 return
308302413.1ms30242.84ms exists $self->{_maximum_violations_per_document}
# spent 2.56ms making 2880 calls to Perl::Critic::Policy::default_maximum_violations_per_document, avg 888ns/call # spent 279┬Ás making 144 calls to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::default_maximum_violations_per_document, avg 2┬Ás/call
309 ? $self->{_maximum_violations_per_document}
310 : $self->default_maximum_violations_per_document();
311}
312
313#-----------------------------------------------------------------------------
314
315
# spent 2.56ms within Perl::Critic::Policy::default_maximum_violations_per_document which was called 2880 times, avg 888ns/call: # 2880 times (2.56ms+0s) by Perl::Critic::Policy::get_maximum_violations_per_document at line 308, avg 888ns/call
sub default_maximum_violations_per_document {
31628807.60ms return;
317}
318
319#-----------------------------------------------------------------------------
320
321sub set_severity {
322 my ($self, $severity) = @_;
323 $self->{_severity} = $severity;
324 return $self;
325}
326
327#-----------------------------------------------------------------------------
328
329
# spent 2.63ms (1.52+1.11) within Perl::Critic::Policy::get_severity which was called 144 times, avg 18┬Ás/call: # 141 times (1.51ms+1.09ms) by Perl::Critic::Config::_policy_is_unimportant at line 288 of Perl/Critic/Config.pm, avg 18┬Ás/call # 3 times (13┬Ás+17┬Ás) by Perl::Critic::Policy::violation at line 419, avg 10┬Ás/call
sub get_severity {
33014418┬Ás my ($self) = @_;
3311441.84ms2881.30ms return $self->{_severity} || $self->default_severity();
# spent 191┬Ás making 144 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call # spent 24┬Ás making 4 calls to Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::default_severity, avg 6┬Ás/call # spent 19┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitUnusedVariables::default_severity # spent 17┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalIsa::default_severity # spent 12┬Ás making 1 call to Perl::Critic::Policy::ErrorHandling::RequireCarping::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::Subroutines::RequireArgUnpacking::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::ErrorHandling::RequireCheckingReturnValueOfEval::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitExplicitStdin::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePodLinksIncludeText::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest::default_severity # spent 11┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitJoinedReadline::default_severity # spent 10┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::default_severity # spent 10┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePodSections::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireCheckedOpen::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitOneArgSelect::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireBracedFileHandleWithPrint::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireCheckedSyscalls::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitTies::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitUnrestrictedNoCritic::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::ProhibitReadlineInForLoop::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireCheckedClose::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitMultiplePackages::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::InputOutput::RequireBriefOpen::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Miscellanea::ProhibitFormats::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitConditionalUseStatements::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitAutomaticExportation::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::default_severity # spent 9┬Ás making 1 call to Perl::Critic::Policy::Modules::ProhibitExcessMainComplexity::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitLvalueSubstr::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireBarewordIncludes::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitBooleanGrep::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitReverseSortBlock::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringySplit::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::RequireUseWarnings::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidMap::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::Documentation::PodSpelling::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireExplicitPackage::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::Documentation::RequirePackageMatchesPodName::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitLeadingZeros::default_severity # spent 8┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireQuotedHeredocTerminator::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalCan::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireNoMatchVarsWithUseEnglish::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitFixedStringMatches::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoWarnings::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::RequireTrailingCommas::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitCascadingIfElse::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::RequireFinalReturn::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitLongChainsOfMethodCalls::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ClassHierarchies::ProhibitAutoloading::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitDeepNests::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireEndWithOne::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitEmptyQuotes::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitEvilVariables::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitLocalVars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ClassHierarchies::ProhibitExplicitISA::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireUpperCaseHeredocTerminator::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockMap::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitTrailingWhitespace::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitUntilBlocks::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireDotMatchAnything::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitAmpersandSigils::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::RequireTestLabels::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitInterpolationOfLiterals::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitVersionStrings::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitAugmentedAssignmentInDeclaration::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitPackageVars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireInitializationForLocalVars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidGrep::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitHardTabs::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::ProhibitQuotedWordLists::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::RequireTidyCode::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitLabelsWithSpecialBlockNames::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitComplexVersion::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitReusedNames::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProtectPrivateVars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireLocalizedPunctuationVars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::CodeLayout::RequireConsistentNewlines::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Objects::ProhibitIndirectSyntax::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitComplexRegexes::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyQuotes::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::RequireConstantVersion::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitPerl4PackageNames::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireSimpleSortBlock::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Modules::RequireVersionVar::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::NamingConventions::Capitalization::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::References::ProhibitDoubleSigils::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitCaptureWithoutTest::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitEscapedMetacharacters::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitSingleCharAlternation::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireBracesForMultiline::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitManyArgs::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitUnusedPrivateSubroutines::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::ValuesAndExpressions::ProhibitMismatchedOperators::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitMatchVars::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::RegularExpressions::ProhibitEnumeratedClasses::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::default_severity # spent 7┬Ás making 1 call to Perl::Critic::Policy::Subroutines::ProtectPrivateSubs::default_severity # spent 6┬Ás making 1 call to Perl::Critic::Policy::Variables::ProhibitPunctuationVars::default_severity # spent 6┬Ás making 1 call to Perl::Critic::Policy::Variables::RequireNegativeIndices::default_severity
332}
333
334#-----------------------------------------------------------------------------
335
336sub default_severity {
337 return $SEVERITY_LOWEST;
338}
339
340#-----------------------------------------------------------------------------
341
342sub set_themes {
343 my ($self, @themes) = @_;
344 $self->{_themes} = [ sort @themes ];
345 return $self;
346}
347
348#-----------------------------------------------------------------------------
349
350sub get_themes {
351 my ($self) = @_;
352 my @themes = defined $self->{_themes} ? @{ $self->{_themes} } : $self->default_themes();
353 my @sorted_themes = sort @themes;
354 return @sorted_themes;
355}
356
357#-----------------------------------------------------------------------------
358
359sub add_themes {
360 my ($self, @additional_themes) = @_;
361 #By hashifying the themes, we squish duplicates
362 my %merged = hashify( $self->get_themes(), @additional_themes);
363 $self->{_themes} = [ keys %merged];
364 return $self;
365}
366
367#-----------------------------------------------------------------------------
368
369sub default_themes {
370 return ();
371}
372
373#-----------------------------------------------------------------------------
374
375sub get_abstract {
376 my ($self) = @_;
377
378 return get_module_abstract_for_module( ref $self );
379}
380
381#-----------------------------------------------------------------------------
382
383sub get_raw_abstract {
384 my ($self) = @_;
385
386 return get_raw_module_abstract_for_module( ref $self );
387}
388
389#-----------------------------------------------------------------------------
390
391sub parameter_metadata_available {
392 my ($self) = @_;
393
394 return $self->{_parameter_metadata_available};
395}
396
397#-----------------------------------------------------------------------------
398
399sub get_parameters {
400 my ($self) = @_;
401
402 return $self->{_parameters};
403}
404
405#-----------------------------------------------------------------------------
406
407sub violates {
408 my ($self) = @_;
409
410 return throw_policy_definition
411 $self->get_short_name() . q/ does not implement violates()./;
412}
413
414#-----------------------------------------------------------------------------
415
416
# spent 85┬Ás (47+38) within Perl::Critic::Policy::violation which was called 3 times, avg 28┬Ás/call: # 3 times (47┬Ás+38┬Ás) by Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::violates at line 45 of Perl/Critic/Policy/Subroutines/ProhibitExplicitReturnUndef.pm, avg 28┬Ás/call
sub violation { ## no critic (ArgUnpacking)
417313┬Ás67┬Ás my ( $self, $desc, $expl, $elem ) = @_;
# spent 7┬Ás making 6 calls to Readonly::Scalar::FETCH, avg 1┬Ás/call
418 # HACK!! Use goto instead of an explicit call because P::C::V::new() uses caller()
41936┬Ás330┬Ás my $sev = $self->get_severity();
# spent 30┬Ás making 3 calls to Perl::Critic::Policy::get_severity, avg 10┬Ás/call
42037┬Ás @_ = ('Perl::Critic::Violation', $desc, $expl, $elem, $sev );
421314┬Ás3817┬Ás goto &Perl::Critic::Violation::new;
# spent 817┬Ás making 3 calls to Perl::Critic::Violation::new, avg 272┬Ás/call
422}
423
424#-----------------------------------------------------------------------------
425
426sub new_parameter_value_exception {
427 my ( $self, $option_name, $option_value, $source, $message_suffix ) = @_;
428
429 return Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue->new(
430 policy => $self->get_short_name(),
431 option_name => $option_name,
432 option_value => $option_value,
433 source => $source,
434 message_suffix => $message_suffix
435 );
436}
437
438#-----------------------------------------------------------------------------
439
440## no critic (Subroutines::RequireFinalReturn)
441sub throw_parameter_value_exception {
442 my ( $self, $option_name, $option_value, $source, $message_suffix ) = @_;
443
444 $self->new_parameter_value_exception(
445 $option_name, $option_value, $source, $message_suffix
446 )
447 ->throw();
448}
449## use critic
450
451
452#-----------------------------------------------------------------------------
453
454# Static methods.
455
456sub set_format { return $format = $_[0] } ## no critic(ArgUnpacking)
457445995┬Ás
# spent 535┬Ás within Perl::Critic::Policy::get_format which was called 445 times, avg 1┬Ás/call: # 445 times (535┬Ás+0s) by Perl::Critic::Policy::to_string at line 478, avg 1┬Ás/call
sub get_format { return $format }
458
459#-----------------------------------------------------------------------------
460
461
# spent 40.6ms (10.2+30.4) within Perl::Critic::Policy::to_string which was called 445 times, avg 91┬Ás/call: # 141 times (3.21ms+13.2ms) by Perl::Critic::PolicyFactory::create_all_policies at line 224 of Perl/Critic/PolicyFactory.pm, avg 117┬Ás/call # 141 times (3.33ms+8.07ms) by Perl::Critic::PolicyFactory::_handle_policy_instantiation_exception at line 280 of Perl/Critic/PolicyFactory.pm, avg 81┬Ás/call # 141 times (3.15ms+7.84ms) by Perl::Critic::Theme::policy_is_thematic at line 86 of Perl/Critic/Theme.pm, avg 78┬Ás/call # 22 times (488┬Ás+1.23ms) by Perl::Critic::Config::add_policy at line 168 of Perl/Critic/Config.pm, avg 78┬Ás/call
sub to_string {
462445295┬Ás my ($self, @args) = @_;
463
464 # Wrap the more expensive ones in sub{} to postpone evaluation
465 my %fspec = (
466 'P' => sub { $self->get_long_name() },
4674454.20ms4459.72ms
# spent 11.2ms (1.47+9.72) within Perl::Critic::Policy::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy.pm:467] which was called 445 times, avg 25┬Ás/call: # 445 times (1.47ms+9.72ms) by String::Format::_replace at line 43 of String/Format.pm, avg 25┬Ás/call
'p' => sub { $self->get_short_name() },
# spent 9.72ms making 445 calls to Perl::Critic::Policy::get_short_name, avg 22┬Ás/call
468 'a' => sub { dor($self->get_abstract(), $EMPTY) },
469 'O' => sub { $self->_format_parameters(@_) },
470 'U' => sub { $self->_format_lack_of_parameter_metadata(@_) },
471 'S' => sub { $self->default_severity() },
472 's' => sub { $self->get_severity() },
473 'T' => sub { join $SPACE, $self->default_themes() },
474 't' => sub { join $SPACE, $self->get_themes() },
475 'V' => sub { dor( $self->default_maximum_violations_per_document(), $NO_LIMIT ) },
476 'v' => sub { dor( $self->get_maximum_violations_per_document(), $NO_LIMIT ) },
4774453.79ms );
4784455.51ms89030.4ms return stringf(get_format(), %fspec);
# spent 29.9ms making 445 calls to String::Format::stringf, avg 67┬Ás/call # spent 535┬Ás making 445 calls to Perl::Critic::Policy::get_format, avg 1┬Ás/call
479}
480
481sub _format_parameters {
482 my ($self, $parameter_format) = @_;
483
484 return $EMPTY if not $self->parameter_metadata_available();
485
486 my $separator;
487 if ($parameter_format) {
488 $separator = $EMPTY;
489 } else {
490 $separator = $SPACE;
491 $parameter_format = '%n';
492 }
493
494 return
495 join
496 $separator,
497 map { $_->to_formatted_string($parameter_format) } @{ $self->get_parameters() };
498}
499
500sub _format_lack_of_parameter_metadata {
501 my ($self, $message) = @_;
502
503 return $EMPTY if $self->parameter_metadata_available();
504 return interpolate($message) if $message;
505
506 return
507 'Cannot programmatically discover what parameters this policy takes.';
508}
509
510#-----------------------------------------------------------------------------
511# Apparently, some perls do not implicitly stringify overloading
512# objects before doing a comparison. This causes a couple of our
513# sorting tests to fail. To work around this, we overload C<cmp> to
514# do it explicitly.
515#
516# 20060503 - More information: This problem has been traced to
517# Test::Simple versions <= 0.60, not perl itself. Upgrading to
518# Test::Simple v0.62 will fix the problem. But rather than forcing
519# everyone to upgrade, I have decided to leave this workaround in
520# place.
521
522sub _compare { return "$_[0]" cmp "$_[1]" }
523
52413┬Ás1;
525
526__END__