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