| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Config.pm |
| Statements | Executed 8168 statements in 23.2ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 8.59ms | 418ms | Perl::Critic::Config::_load_policies |
| 5 | 5 | 1 | 5.33ms | 6.17ms | Perl::Critic::Config::_validate_and_save_color_severity |
| 1 | 1 | 1 | 1.65ms | 1.31s | Perl::Critic::Config::BEGIN@24 |
| 1 | 1 | 1 | 1.19ms | 8.20ms | Perl::Critic::Config::BEGIN@26 |
| 289 | 2 | 1 | 1.07ms | 1.07ms | Perl::Critic::Config::policies |
| 141 | 1 | 1 | 1.07ms | 1.37ms | Perl::Critic::Config::_policy_is_included |
| 141 | 1 | 1 | 944µs | 1.21ms | Perl::Critic::Config::_policy_is_excluded |
| 141 | 1 | 1 | 898µs | 3.50ms | Perl::Critic::Config::_policy_is_unimportant |
| 141 | 1 | 1 | 817µs | 12.9ms | Perl::Critic::Config::_policy_is_thematic |
| 141 | 1 | 1 | 781µs | 3.23ms | Perl::Critic::Config::_policy_is_enabled |
| 141 | 1 | 1 | 778µs | 3.49ms | Perl::Critic::Config::_policy_is_disabled |
| 1 | 1 | 1 | 709µs | 1.96ms | Perl::Critic::Config::BEGIN@25 |
| 144 | 1 | 1 | 530µs | 549µs | Perl::Critic::Config::program_extensions_as_regexes |
| 1 | 1 | 1 | 514µs | 1.57ms | Perl::Critic::Config::BEGIN@20 |
| 144 | 1 | 1 | 342µs | 342µs | Perl::Critic::Config::force |
| 22 | 1 | 1 | 331µs | 654µs | Perl::Critic::Config::_add_policy_if_enabled |
| 297 | 11 | 1 | 317µs | 317µs | Perl::Critic::Config::_profile |
| 1 | 1 | 1 | 310µs | 1.82ms | Perl::Critic::Config::BEGIN@22 |
| 1 | 1 | 1 | 258µs | 426ms | Perl::Critic::Config::_init |
| 22 | 1 | 1 | 243µs | 2.64ms | Perl::Critic::Config::add_policy |
| 142 | 2 | 1 | 211µs | 211µs | Perl::Critic::Config::single_policy |
| 141 | 1 | 1 | 193µs | 193µs | Perl::Critic::Config::only |
| 141 | 1 | 1 | 184µs | 184µs | Perl::Critic::Config::include |
| 141 | 1 | 1 | 171µs | 171µs | Perl::Critic::Config::exclude |
| 141 | 1 | 1 | 154µs | 154µs | Perl::Critic::Config::theme |
| 1 | 1 | 1 | 66µs | 161µs | Perl::Critic::Config::_validate_and_save_theme |
| 3 | 3 | 1 | 58µs | 71µs | Perl::Critic::Config::_validate_and_save_regex |
| 1 | 1 | 1 | 30µs | 42µs | Perl::Critic::Config::_validate_and_save_severity |
| 1 | 1 | 1 | 29µs | 40µs | Perl::Critic::Config::_validate_and_save_profile_strictness |
| 1 | 1 | 1 | 28µs | 56µs | Perl::Critic::Config::_validate_and_save_verbosity |
| 29 | 7 | 1 | 27µs | 27µs | Perl::Critic::Config::CORE:subst (opcode) |
| 1 | 1 | 1 | 24µs | 30µs | Perl::Critic::Config::_validate_and_save_pager |
| 1 | 1 | 1 | 24µs | 31µs | Perl::Critic::Config::_validate_and_save_program_extensions |
| 1 | 1 | 1 | 22µs | 32µs | Perl::Critic::Config::_validate_and_save_top |
| 2 | 2 | 1 | 18µs | 19µs | Perl::Critic::Config::CORE:regcomp (opcode) |
| 1 | 1 | 1 | 14µs | 14µs | Perl::Critic::Config::BEGIN@10 |
| 1 | 1 | 1 | 11µs | 426ms | Perl::Critic::Config::new |
| 1 | 1 | 1 | 9µs | 21µs | Perl::Critic::Config::BEGIN@21 |
| 1 | 1 | 1 | 8µs | 12µs | Perl::Critic::Config::BEGIN@12 |
| 1 | 1 | 1 | 8µs | 120µs | Perl::Critic::Config::BEGIN@31 |
| 1 | 1 | 1 | 8µs | 32µs | Perl::Critic::Config::BEGIN@35 |
| 1 | 1 | 1 | 7µs | 680µs | Perl::Critic::Config::BEGIN@27 |
| 1 | 1 | 1 | 7µs | 359µs | Perl::Critic::Config::BEGIN@14 |
| 1 | 1 | 1 | 7µs | 26µs | Perl::Critic::Config::BEGIN@23 |
| 1 | 1 | 1 | 7µs | 26µs | Perl::Critic::Config::BEGIN@15 |
| 1 | 1 | 1 | 7µs | 27µs | Perl::Critic::Config::BEGIN@18 |
| 1 | 1 | 1 | 6µs | 17µs | Perl::Critic::Config::BEGIN@11 |
| 1 | 1 | 1 | 6µs | 231µs | Perl::Critic::Config::BEGIN@17 |
| 1 | 1 | 1 | 3µs | 3µs | Perl::Critic::Config::pager |
| 1 | 1 | 1 | 3µs | 3µs | Perl::Critic::Config::program_extensions |
| 1 | 1 | 1 | 2µs | 2µs | Perl::Critic::Config::profile_strictness |
| 1 | 1 | 1 | 2µs | 2µs | Perl::Critic::Config::CORE:qr (opcode) |
| 1 | 1 | 1 | 1µs | 1µs | Perl::Critic::Config::CORE:sort (opcode) |
| 1 | 1 | 1 | 300ns | 300ns | Perl::Critic::Config::CORE:match (opcode) |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::__ANON__[:299] |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::__ANON__[:308] |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::__ANON__[:320] |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::__ANON__[:348] |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::__ANON__[:547] |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::_add_single_policy_exception_to |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::_new_global_value_exception |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::_policy_is_single_policy |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::all_policies_enabled_or_not |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::color |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::color_severity_high |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::color_severity_highest |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::color_severity_low |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::color_severity_lowest |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::color_severity_medium |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::criticism_fatal |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::severity |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::site_policy_names |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::top |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::unsafe_allowed |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Config::verbose |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | ############################################################################## | ||||
| 2 | # $URL$ | ||||
| 3 | # $Date$ | ||||
| 4 | # $Author$ | ||||
| 5 | # $Revision$ | ||||
| 6 | ############################################################################## | ||||
| 7 | |||||
| 8 | package Perl::Critic::Config; | ||||
| 9 | |||||
| 10 | 2 | 35µs | 1 | 14µs | # spent 14µs within Perl::Critic::Config::BEGIN@10 which was called:
# once (14µs+0s) by Perl::Critic::BEGIN@24 at line 10 # spent 14µs making 1 call to Perl::Critic::Config::BEGIN@10 |
| 11 | 2 | 18µs | 2 | 28µs | # spent 17µs (6+11) within Perl::Critic::Config::BEGIN@11 which was called:
# once (6µs+11µs) by Perl::Critic::BEGIN@24 at line 11 # spent 17µs making 1 call to Perl::Critic::Config::BEGIN@11
# spent 11µs making 1 call to strict::import |
| 12 | 2 | 19µs | 2 | 16µs | # spent 12µs (8+4) within Perl::Critic::Config::BEGIN@12 which was called:
# once (8µs+4µs) by Perl::Critic::BEGIN@24 at line 12 # spent 12µs making 1 call to Perl::Critic::Config::BEGIN@12
# spent 4µs making 1 call to warnings::import |
| 13 | |||||
| 14 | 2 | 20µs | 2 | 711µs | # spent 359µs (7+352) within Perl::Critic::Config::BEGIN@14 which was called:
# once (7µs+352µs) by Perl::Critic::BEGIN@24 at line 14 # spent 359µs making 1 call to Perl::Critic::Config::BEGIN@14
# spent 352µs making 1 call to English::import |
| 15 | 2 | 21µs | 2 | 44µs | # spent 26µs (7+19) within Perl::Critic::Config::BEGIN@15 which was called:
# once (7µs+19µs) by Perl::Critic::BEGIN@24 at line 15 # spent 26µs making 1 call to Perl::Critic::Config::BEGIN@15
# spent 19µs making 1 call to Exporter::import |
| 16 | |||||
| 17 | 2 | 23µs | 2 | 455µs | # spent 231µs (6+224) within Perl::Critic::Config::BEGIN@17 which was called:
# once (6µs+224µs) by Perl::Critic::BEGIN@24 at line 17 # spent 231µs making 1 call to Perl::Critic::Config::BEGIN@17
# spent 224µs making 1 call to Exporter::Tiny::import |
| 18 | 2 | 19µs | 2 | 47µs | # spent 27µs (7+20) within Perl::Critic::Config::BEGIN@18 which was called:
# once (7µs+20µs) by Perl::Critic::BEGIN@24 at line 18 # spent 27µs making 1 call to Perl::Critic::Config::BEGIN@18
# spent 20µs making 1 call to Exporter::import |
| 19 | |||||
| 20 | 2 | 89µs | 2 | 1.59ms | # spent 1.57ms (514µs+1.06) within Perl::Critic::Config::BEGIN@20 which was called:
# once (514µs+1.06ms) by Perl::Critic::BEGIN@24 at line 20 # spent 1.57ms making 1 call to Perl::Critic::Config::BEGIN@20
# spent 17µs making 1 call to Exporter::import |
| 21 | 2 | 20µs | 2 | 33µs | # spent 21µs (9+12) within Perl::Critic::Config::BEGIN@21 which was called:
# once (9µs+12µs) by Perl::Critic::BEGIN@24 at line 21 # spent 21µs making 1 call to Perl::Critic::Config::BEGIN@21
# spent 12µs making 1 call to Exporter::import |
| 22 | 2 | 95µs | 2 | 1.83ms | # spent 1.82ms (310µs+1.51) within Perl::Critic::Config::BEGIN@22 which was called:
# once (310µs+1.51ms) by Perl::Critic::BEGIN@24 at line 22 # spent 1.82ms making 1 call to Perl::Critic::Config::BEGIN@22
# spent 15µs making 1 call to Exporter::import |
| 23 | 2 | 19µs | 2 | 46µs | # spent 26µs (7+19) within Perl::Critic::Config::BEGIN@23 which was called:
# once (7µs+19µs) by Perl::Critic::BEGIN@24 at line 23 # spent 26µs making 1 call to Perl::Critic::Config::BEGIN@23
# spent 19µs making 1 call to Exporter::import |
| 24 | 2 | 95µs | 2 | 2.62s | # spent 1.31s (1.65ms+1.31) within Perl::Critic::Config::BEGIN@24 which was called:
# once (1.65ms+1.31s) by Perl::Critic::BEGIN@24 at line 24 # spent 1.31s making 1 call to Perl::Critic::Config::BEGIN@24
# spent 1.30s making 1 call to Perl::Critic::PolicyFactory::import |
| 25 | 2 | 91µs | 2 | 2.04ms | # spent 1.96ms (709µs+1.25) within Perl::Critic::Config::BEGIN@25 which was called:
# once (709µs+1.25ms) by Perl::Critic::BEGIN@24 at line 25 # spent 1.96ms making 1 call to Perl::Critic::Config::BEGIN@25
# spent 84µs making 1 call to Exporter::import |
| 26 | 2 | 92µs | 1 | 8.20ms | # spent 8.20ms (1.19+7.00) within Perl::Critic::Config::BEGIN@26 which was called:
# once (1.19ms+7.00ms) by Perl::Critic::BEGIN@24 at line 26 # spent 8.20ms making 1 call to Perl::Critic::Config::BEGIN@26 |
| 27 | 1 | 200ns | # spent 680µs (7+673) within Perl::Critic::Config::BEGIN@27 which was called:
# once (7µs+673µs) by Perl::Critic::BEGIN@24 at line 30 | ||
| 28 | :booleans :characters :severities :internal_lookup :classification | ||||
| 29 | :data_conversion | ||||
| 30 | 1 | 28µs | 2 | 1.35ms | }; # spent 680µs making 1 call to Perl::Critic::Config::BEGIN@27
# spent 673µs making 1 call to Exporter::import |
| 31 | 1 | 400ns | # spent 120µs (8+112) within Perl::Critic::Config::BEGIN@31 which was called:
# once (8µs+112µs) by Perl::Critic::BEGIN@24 at line 34 | ||
| 32 | :profile_strictness | ||||
| 33 | $_MODULE_VERSION_TERM_ANSICOLOR | ||||
| 34 | 1 | 25µs | 2 | 232µs | >; # spent 120µs making 1 call to Perl::Critic::Config::BEGIN@31
# spent 112µs making 1 call to Exporter::import |
| 35 | 2 | 2.79ms | 2 | 56µs | # spent 32µs (8+24) within Perl::Critic::Config::BEGIN@35 which was called:
# once (8µs+24µs) by Perl::Critic::BEGIN@24 at line 35 # spent 32µs making 1 call to Perl::Critic::Config::BEGIN@35
# spent 24µs making 1 call to Exporter::import |
| 36 | |||||
| 37 | #----------------------------------------------------------------------------- | ||||
| 38 | |||||
| 39 | 1 | 700ns | our $VERSION = '1.121'; | ||
| 40 | |||||
| 41 | #----------------------------------------------------------------------------- | ||||
| 42 | |||||
| 43 | 1 | 2µs | 1 | 35µs | Readonly::Scalar my $SINGLE_POLICY_CONFIG_KEY => 'single-policy'; # spent 35µs making 1 call to Readonly::Scalar |
| 44 | |||||
| 45 | #----------------------------------------------------------------------------- | ||||
| 46 | # Constructor | ||||
| 47 | |||||
| 48 | # spent 426ms (11µs+426) within Perl::Critic::Config::new which was called:
# once (11µs+426ms) by Perl::Critic::new at line 42 of Perl/Critic.pm | ||||
| 49 | |||||
| 50 | 1 | 900ns | my ( $class, %args ) = @_; | ||
| 51 | 1 | 1µs | my $self = bless {}, $class; | ||
| 52 | 1 | 3µs | 1 | 426ms | $self->_init( %args ); # spent 426ms making 1 call to Perl::Critic::Config::_init |
| 53 | 1 | 4µs | return $self; | ||
| 54 | } | ||||
| 55 | |||||
| 56 | #----------------------------------------------------------------------------- | ||||
| 57 | |||||
| 58 | # spent 426ms (258µs+426) within Perl::Critic::Config::_init which was called:
# once (258µs+426ms) by Perl::Critic::Config::new at line 52 | ||||
| 59 | 1 | 700ns | my ( $self, %args ) = @_; | ||
| 60 | |||||
| 61 | # -top or -theme imply that -severity is 1, unless it is already defined | ||||
| 62 | 1 | 2µs | if ( defined $args{-top} || defined $args{-theme} ) { | ||
| 63 | $args{-severity} ||= $SEVERITY_LOWEST; | ||||
| 64 | } | ||||
| 65 | |||||
| 66 | 1 | 3µs | 1 | 601µs | my $errors = Perl::Critic::Exception::AggregateConfiguration->new(); # spent 601µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::new |
| 67 | |||||
| 68 | # Construct the UserProfile to get default options. | ||||
| 69 | 1 | 1µs | my $profile_source = $args{-profile}; # Can be file path or data struct | ||
| 70 | 1 | 5µs | 1 | 635µs | my $profile = Perl::Critic::UserProfile->new( -profile => $profile_source ); # spent 635µs making 1 call to Perl::Critic::UserProfile::new |
| 71 | 1 | 2µs | 1 | 2µs | my $options_processor = $profile->options_processor(); # spent 2µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 72 | 1 | 2µs | $self->{_profile} = $profile; | ||
| 73 | |||||
| 74 | 1 | 3µs | 1 | 40µs | $self->_validate_and_save_profile_strictness( # spent 40µs making 1 call to Perl::Critic::Config::_validate_and_save_profile_strictness |
| 75 | $args{'-profile-strictness'}, | ||||
| 76 | $errors, | ||||
| 77 | ); | ||||
| 78 | |||||
| 79 | # If given, these options should always have a true value. | ||||
| 80 | 1 | 6µs | 2 | 36µs | $self->_validate_and_save_regex( # spent 34µs making 1 call to Perl::Critic::Config::_validate_and_save_regex
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::include |
| 81 | 'include', $args{-include}, $options_processor->include(), $errors | ||||
| 82 | ); | ||||
| 83 | 1 | 5µs | 2 | 17µs | $self->_validate_and_save_regex( # spent 14µs making 1 call to Perl::Critic::Config::_validate_and_save_regex
# spent 3µs making 1 call to Perl::Critic::OptionsProcessor::exclude |
| 84 | 'exclude', $args{-exclude}, $options_processor->exclude(), $errors | ||||
| 85 | ); | ||||
| 86 | 1 | 7µs | 3 | 26µs | $self->_validate_and_save_regex( # spent 22µs making 1 call to Perl::Critic::Config::_validate_and_save_regex
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::single_policy
# spent 2µs making 1 call to Readonly::Scalar::FETCH |
| 87 | $SINGLE_POLICY_CONFIG_KEY, | ||||
| 88 | $args{ qq/-$SINGLE_POLICY_CONFIG_KEY/ }, | ||||
| 89 | $options_processor->single_policy(), | ||||
| 90 | $errors, | ||||
| 91 | ); | ||||
| 92 | 1 | 6µs | 2 | 5.96ms | $self->_validate_and_save_color_severity( # spent 5.96ms making 1 call to Perl::Critic::Config::_validate_and_save_color_severity
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::color_severity_highest |
| 93 | 'color_severity_highest', $args{'-color-severity-highest'}, | ||||
| 94 | $options_processor->color_severity_highest(), $errors | ||||
| 95 | ); | ||||
| 96 | 1 | 6µs | 2 | 69µs | $self->_validate_and_save_color_severity( # spent 66µs making 1 call to Perl::Critic::Config::_validate_and_save_color_severity
# spent 3µs making 1 call to Perl::Critic::OptionsProcessor::color_severity_high |
| 97 | 'color_severity_high', $args{'-color-severity-high'}, | ||||
| 98 | $options_processor->color_severity_high(), $errors | ||||
| 99 | ); | ||||
| 100 | 1 | 4µs | 2 | 51µs | $self->_validate_and_save_color_severity( # spent 49µs making 1 call to Perl::Critic::Config::_validate_and_save_color_severity
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::color_severity_medium |
| 101 | 'color_severity_medium', $args{'-color-severity-medium'}, | ||||
| 102 | $options_processor->color_severity_medium(), $errors | ||||
| 103 | ); | ||||
| 104 | 1 | 4µs | 2 | 50µs | $self->_validate_and_save_color_severity( # spent 48µs making 1 call to Perl::Critic::Config::_validate_and_save_color_severity
# spent 3µs making 1 call to Perl::Critic::OptionsProcessor::color_severity_low |
| 105 | 'color_severity_low', $args{'-color-severity-low'}, | ||||
| 106 | $options_processor->color_severity_low(), $errors | ||||
| 107 | ); | ||||
| 108 | 1 | 4µs | 2 | 48µs | $self->_validate_and_save_color_severity( # spent 46µs making 1 call to Perl::Critic::Config::_validate_and_save_color_severity
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::color_severity_lowest |
| 109 | 'color_severity_lowest', $args{'-color-severity-lowest'}, | ||||
| 110 | $options_processor->color_severity_lowest(), $errors | ||||
| 111 | ); | ||||
| 112 | |||||
| 113 | 1 | 4µs | 1 | 56µs | $self->_validate_and_save_verbosity($args{-verbose}, $errors); # spent 56µs making 1 call to Perl::Critic::Config::_validate_and_save_verbosity |
| 114 | 1 | 3µs | 1 | 42µs | $self->_validate_and_save_severity($args{-severity}, $errors); # spent 42µs making 1 call to Perl::Critic::Config::_validate_and_save_severity |
| 115 | 1 | 3µs | 1 | 32µs | $self->_validate_and_save_top($args{-top}, $errors); # spent 32µs making 1 call to Perl::Critic::Config::_validate_and_save_top |
| 116 | 1 | 3µs | 1 | 161µs | $self->_validate_and_save_theme($args{-theme}, $errors); # spent 161µs making 1 call to Perl::Critic::Config::_validate_and_save_theme |
| 117 | 1 | 3µs | 1 | 30µs | $self->_validate_and_save_pager($args{-pager}, $errors); # spent 30µs making 1 call to Perl::Critic::Config::_validate_and_save_pager |
| 118 | 1 | 3µs | 1 | 31µs | $self->_validate_and_save_program_extensions( # spent 31µs making 1 call to Perl::Critic::Config::_validate_and_save_program_extensions |
| 119 | $args{'-program-extensions'}, $errors); | ||||
| 120 | |||||
| 121 | # If given, these options can be true or false (but defined) | ||||
| 122 | # We normalize these to numeric values by multiplying them by 1; | ||||
| 123 | 1 | 11µs | 4 | 16µs | $self->{_force} = boolean_to_number( dor( $args{-force}, $options_processor->force() ) ); # spent 8µs making 1 call to Perl::Critic::Utils::DataConversion::boolean_to_number
# spent 4µs making 1 call to Perl::Critic::Utils::DataConversion::dor
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::force
# spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 124 | 1 | 8µs | 4 | 11µs | $self->{_only} = boolean_to_number( dor( $args{-only}, $options_processor->only() ) ); # spent 6µs making 1 call to Perl::Critic::Utils::DataConversion::boolean_to_number
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::only
# spent 2µs making 1 call to Perl::Critic::Utils::DataConversion::dor
# spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 125 | 1 | 7µs | 4 | 11µs | $self->{_color} = boolean_to_number( dor( $args{-color}, $options_processor->color() ) ); # spent 6µs making 1 call to Perl::Critic::Utils::DataConversion::boolean_to_number
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::color
# spent 2µs making 1 call to Perl::Critic::Utils::DataConversion::dor
# spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 126 | 1 | 7µs | 4 | 13µs | $self->{_unsafe_allowed} = # spent 8µs making 1 call to Perl::Critic::Utils::DataConversion::boolean_to_number
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::allow_unsafe
# spent 2µs making 1 call to Perl::Critic::Utils::DataConversion::dor
# spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 127 | boolean_to_number( | ||||
| 128 | dor( $args{'-allow-unsafe'}, $options_processor->allow_unsafe() | ||||
| 129 | ) ); | ||||
| 130 | 1 | 7µs | 4 | 10µs | $self->{_criticism_fatal} = # spent 5µs making 1 call to Perl::Critic::Utils::DataConversion::boolean_to_number
# spent 2µs making 1 call to Perl::Critic::OptionsProcessor::criticism_fatal
# spent 2µs making 1 call to Perl::Critic::Utils::DataConversion::dor
# spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 131 | boolean_to_number( | ||||
| 132 | dor( $args{'-criticism-fatal'}, $options_processor->criticism_fatal() ) | ||||
| 133 | ); | ||||
| 134 | |||||
| 135 | |||||
| 136 | # Construct a Factory with the Profile | ||||
| 137 | 1 | 6µs | 2 | 190µs | my $factory = # spent 188µs making 1 call to Perl::Critic::PolicyFactory::new
# spent 2µs making 1 call to Perl::Critic::Config::profile_strictness |
| 138 | Perl::Critic::PolicyFactory->new( | ||||
| 139 | -profile => $profile, | ||||
| 140 | -errors => $errors, | ||||
| 141 | '-profile-strictness' => $self->profile_strictness(), | ||||
| 142 | ); | ||||
| 143 | 1 | 500ns | $self->{_factory} = $factory; | ||
| 144 | |||||
| 145 | # Initialize internal storage for Policies | ||||
| 146 | 1 | 400ns | $self->{_all_policies_enabled_or_not} = []; | ||
| 147 | 1 | 500ns | $self->{_policies} = []; | ||
| 148 | |||||
| 149 | # "NONE" means don't load any policies | ||||
| 150 | 1 | 3µs | 1 | 418ms | if ( not defined $profile_source or $profile_source ne 'NONE' ) { # spent 418ms making 1 call to Perl::Critic::Config::_load_policies |
| 151 | # Heavy lifting here... | ||||
| 152 | $self->_load_policies($errors); | ||||
| 153 | } | ||||
| 154 | |||||
| 155 | 1 | 3µs | 1 | 7µs | if ( $errors->has_exceptions() ) { # spent 7µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::has_exceptions |
| 156 | $errors->rethrow(); | ||||
| 157 | } | ||||
| 158 | |||||
| 159 | 1 | 44µs | return $self; | ||
| 160 | } | ||||
| 161 | |||||
| 162 | #----------------------------------------------------------------------------- | ||||
| 163 | |||||
| 164 | # spent 2.64ms (243µs+2.40) within Perl::Critic::Config::add_policy which was called 22 times, avg 120µs/call:
# 22 times (243µs+2.40ms) by Perl::Critic::Config::_load_policies at line 249, avg 120µs/call | ||||
| 165 | |||||
| 166 | 22 | 16µs | my ( $self, %args ) = @_; | ||
| 167 | |||||
| 168 | 22 | 54µs | 22 | 1.71ms | if ( not $args{-policy} ) { # spent 1.71ms making 22 calls to Perl::Critic::Policy::to_string, avg 78µs/call |
| 169 | throw_internal q{The -policy argument is required}; | ||||
| 170 | } | ||||
| 171 | |||||
| 172 | 22 | 12µs | my $policy = $args{-policy}; | ||
| 173 | |||||
| 174 | # If the -policy is already a blessed object, then just add it directly. | ||||
| 175 | 22 | 78µs | 22 | 32µs | if ( blessed $policy ) { # spent 32µs making 22 calls to Scalar::Util::blessed, avg 1µs/call |
| 176 | 22 | 25µs | 22 | 654µs | $self->_add_policy_if_enabled($policy); # spent 654µs making 22 calls to Perl::Critic::Config::_add_policy_if_enabled, avg 30µs/call |
| 177 | 22 | 52µs | return $self; | ||
| 178 | } | ||||
| 179 | |||||
| 180 | # NOTE: The "-config" option is supported for backward compatibility. | ||||
| 181 | my $params = $args{-params} || $args{-config}; | ||||
| 182 | |||||
| 183 | my $factory = $self->{_factory}; | ||||
| 184 | my $policy_object = | ||||
| 185 | $factory->create_policy(-name=>$policy, -params=>$params); | ||||
| 186 | $self->_add_policy_if_enabled($policy_object); | ||||
| 187 | |||||
| 188 | return $self; | ||||
| 189 | } | ||||
| 190 | |||||
| 191 | #----------------------------------------------------------------------------- | ||||
| 192 | |||||
| 193 | # spent 654µs (331+322) within Perl::Critic::Config::_add_policy_if_enabled which was called 22 times, avg 30µs/call:
# 22 times (331µs+322µs) by Perl::Critic::Config::add_policy at line 176, avg 30µs/call | ||||
| 194 | 22 | 6µs | my ( $self, $policy_object ) = @_; | ||
| 195 | |||||
| 196 | 22 | 34µs | 22 | 34µs | my $config = $policy_object->__get_config() # spent 34µs making 22 calls to Perl::Critic::Policy::__get_config, avg 2µs/call |
| 197 | or throw_internal | ||||
| 198 | q{Policy was not set up properly because it does not have } | ||||
| 199 | . q{a value for its config attribute.}; | ||||
| 200 | |||||
| 201 | 22 | 17µs | push @{ $self->{_all_policies_enabled_or_not} }, $policy_object; | ||
| 202 | 22 | 126µs | 42 | 178µs | if ( $policy_object->initialize_if_enabled( $config ) ) { # spent 106µs making 19 calls to Perl::Critic::Policy::initialize_if_enabled, avg 6µs/call
# spent 35µs making 1 call to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::initialize_if_enabled
# spent 29µs making 20 calls to Readonly::Scalar::FETCH, avg 1µs/call
# spent 4µs making 1 call to Perl::Critic::Policy::Variables::ProhibitEvilVariables::initialize_if_enabled
# spent 4µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::initialize_if_enabled |
| 203 | 21 | 55µs | 21 | 133µs | $policy_object->__set_enabled($TRUE); # spent 133µs making 21 calls to Perl::Critic::Policy::__set_enabled, avg 6µs/call |
| 204 | 21 | 17µs | push @{ $self->{_policies} }, $policy_object; | ||
| 205 | } | ||||
| 206 | else { | ||||
| 207 | 1 | 3µs | 1 | 6µs | $policy_object->__set_enabled($FALSE); # spent 6µs making 1 call to Perl::Critic::Policy::__set_enabled |
| 208 | } | ||||
| 209 | |||||
| 210 | 22 | 41µs | return; | ||
| 211 | } | ||||
| 212 | |||||
| 213 | #----------------------------------------------------------------------------- | ||||
| 214 | |||||
| 215 | # spent 418ms (8.59+409) within Perl::Critic::Config::_load_policies which was called:
# once (8.59ms+409ms) by Perl::Critic::Config::_init at line 150 | ||||
| 216 | |||||
| 217 | 1 | 400ns | my ( $self, $errors ) = @_; | ||
| 218 | 1 | 400ns | my $factory = $self->{_factory}; | ||
| 219 | 1 | 9µs | 1 | 379ms | my @policies = $factory->create_all_policies( $errors ); # spent 379ms making 1 call to Perl::Critic::PolicyFactory::create_all_policies |
| 220 | |||||
| 221 | 1 | 2µs | 1 | 5µs | return if $errors->has_exceptions(); # spent 5µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::has_exceptions |
| 222 | |||||
| 223 | 1 | 24µs | for my $policy ( @policies ) { | ||
| 224 | |||||
| 225 | # If -single-policy is true, only load policies that match it | ||||
| 226 | 141 | 160µs | 141 | 210µs | if ( $self->single_policy() ) { # spent 210µs making 141 calls to Perl::Critic::Config::single_policy, avg 1µs/call |
| 227 | if ( $self->_policy_is_single_policy( $policy ) ) { | ||||
| 228 | $self->add_policy( -policy => $policy ); | ||||
| 229 | } | ||||
| 230 | next; | ||||
| 231 | } | ||||
| 232 | |||||
| 233 | # Always exclude unsafe policies, unless instructed not to | ||||
| 234 | 141 | 853µs | 282 | 967µs | next if not ( $policy->is_safe() or $self->unsafe_allowed() ); # spent 760µs making 141 calls to Perl::Critic::Policy::is_safe, avg 5µs/call
# spent 207µs making 141 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 235 | |||||
| 236 | # To load, or not to load -- that is the question. | ||||
| 237 | 141 | 408µs | 282 | 352µs | my $load_me = $self->only() ? $FALSE : $TRUE; # spent 193µs making 141 calls to Perl::Critic::Config::only, avg 1µs/call
# spent 158µs making 141 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 238 | |||||
| 239 | ## no critic (ProhibitPostfixControls) | ||||
| 240 | 141 | 170µs | 141 | 3.49ms | $load_me = $FALSE if $self->_policy_is_disabled( $policy ); # spent 3.49ms making 141 calls to Perl::Critic::Config::_policy_is_disabled, avg 25µs/call |
| 241 | 141 | 188µs | 141 | 3.23ms | $load_me = $TRUE if $self->_policy_is_enabled( $policy ); # spent 3.23ms making 141 calls to Perl::Critic::Config::_policy_is_enabled, avg 23µs/call |
| 242 | 141 | 408µs | 260 | 3.64ms | $load_me = $FALSE if $self->_policy_is_unimportant( $policy ); # spent 3.50ms making 141 calls to Perl::Critic::Config::_policy_is_unimportant, avg 25µs/call
# spent 136µs making 119 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 243 | 141 | 155µs | 141 | 12.9ms | $load_me = $FALSE if not $self->_policy_is_thematic( $policy ); # spent 12.9ms making 141 calls to Perl::Critic::Config::_policy_is_thematic, avg 91µs/call |
| 244 | 141 | 324µs | 141 | 1.37ms | $load_me = $TRUE if $self->_policy_is_included( $policy ); # spent 1.37ms making 141 calls to Perl::Critic::Config::_policy_is_included, avg 10µs/call |
| 245 | 141 | 264µs | 141 | 1.21ms | $load_me = $FALSE if $self->_policy_is_excluded( $policy ); # spent 1.21ms making 141 calls to Perl::Critic::Config::_policy_is_excluded, avg 9µs/call |
| 246 | |||||
| 247 | |||||
| 248 | 141 | 78µs | next if not $load_me; | ||
| 249 | 22 | 48µs | 22 | 2.64ms | $self->add_policy( -policy => $policy ); # spent 2.64ms making 22 calls to Perl::Critic::Config::add_policy, avg 120µs/call |
| 250 | } | ||||
| 251 | |||||
| 252 | # When using -single-policy, only one policy should ever be loaded. | ||||
| 253 | 1 | 1µs | 1 | 1µs | if ($self->single_policy() && scalar $self->policies() != 1) { # spent 1µs making 1 call to Perl::Critic::Config::single_policy |
| 254 | $self->_add_single_policy_exception_to($errors); | ||||
| 255 | } | ||||
| 256 | |||||
| 257 | 1 | 771µs | return; | ||
| 258 | } | ||||
| 259 | |||||
| 260 | #----------------------------------------------------------------------------- | ||||
| 261 | |||||
| 262 | # spent 3.49ms (778µs+2.71) within Perl::Critic::Config::_policy_is_disabled which was called 141 times, avg 25µs/call:
# 141 times (778µs+2.71ms) by Perl::Critic::Config::_load_policies at line 240, avg 25µs/call | ||||
| 263 | 141 | 30µs | my ($self, $policy) = @_; | ||
| 264 | 141 | 139µs | 141 | 151µs | my $profile = $self->_profile(); # spent 151µs making 141 calls to Perl::Critic::Config::_profile, avg 1µs/call |
| 265 | 141 | 359µs | 141 | 2.56ms | return $profile->policy_is_disabled( $policy ); # spent 2.56ms making 141 calls to Perl::Critic::UserProfile::policy_is_disabled, avg 18µs/call |
| 266 | } | ||||
| 267 | |||||
| 268 | #----------------------------------------------------------------------------- | ||||
| 269 | |||||
| 270 | # spent 3.23ms (781µs+2.44) within Perl::Critic::Config::_policy_is_enabled which was called 141 times, avg 23µs/call:
# 141 times (781µs+2.44ms) by Perl::Critic::Config::_load_policies at line 241, avg 23µs/call | ||||
| 271 | 141 | 32µs | my ($self, $policy) = @_; | ||
| 272 | 141 | 126µs | 141 | 148µs | my $profile = $self->_profile(); # spent 148µs making 141 calls to Perl::Critic::Config::_profile, avg 1µs/call |
| 273 | 141 | 362µs | 141 | 2.30ms | return $profile->policy_is_enabled( $policy ); # spent 2.30ms making 141 calls to Perl::Critic::UserProfile::policy_is_enabled, avg 16µs/call |
| 274 | } | ||||
| 275 | |||||
| 276 | #----------------------------------------------------------------------------- | ||||
| 277 | |||||
| 278 | # spent 12.9ms (817µs+12.1) within Perl::Critic::Config::_policy_is_thematic which was called 141 times, avg 91µs/call:
# 141 times (817µs+12.1ms) by Perl::Critic::Config::_load_policies at line 243, avg 91µs/call | ||||
| 279 | 141 | 31µs | my ($self, $policy) = @_; | ||
| 280 | 141 | 138µs | 141 | 154µs | my $theme = $self->theme(); # spent 154µs making 141 calls to Perl::Critic::Config::theme, avg 1µs/call |
| 281 | 141 | 401µs | 141 | 11.9ms | return $theme->policy_is_thematic( -policy => $policy ); # spent 11.9ms making 141 calls to Perl::Critic::Theme::policy_is_thematic, avg 85µs/call |
| 282 | } | ||||
| 283 | |||||
| 284 | #----------------------------------------------------------------------------- | ||||
| 285 | |||||
| 286 | # spent 3.50ms (898µs+2.60) within Perl::Critic::Config::_policy_is_unimportant which was called 141 times, avg 25µs/call:
# 141 times (898µs+2.60ms) by Perl::Critic::Config::_load_policies at line 242, avg 25µs/call | ||||
| 287 | 141 | 40µs | my ($self, $policy) = @_; | ||
| 288 | 141 | 442µs | 141 | 2.60ms | my $policy_severity = $policy->get_severity(); # spent 2.60ms making 141 calls to Perl::Critic::Policy::get_severity, avg 18µs/call |
| 289 | 141 | 43µs | my $min_severity = $self->{_severity}; | ||
| 290 | 141 | 290µs | return $policy_severity < $min_severity; | ||
| 291 | } | ||||
| 292 | |||||
| 293 | #----------------------------------------------------------------------------- | ||||
| 294 | |||||
| 295 | # spent 1.37ms (1.07+302µs) within Perl::Critic::Config::_policy_is_included which was called 141 times, avg 10µs/call:
# 141 times (1.07ms+302µs) by Perl::Critic::Config::_load_policies at line 244, avg 10µs/call | ||||
| 296 | 141 | 35µs | my ($self, $policy) = @_; | ||
| 297 | 141 | 42µs | my $policy_long_name = ref $policy; | ||
| 298 | 141 | 162µs | 141 | 184µs | my @inclusions = $self->include(); # spent 184µs making 141 calls to Perl::Critic::Config::include, avg 1µs/call |
| 299 | 141 | 808µs | 141 | 118µs | return any { $policy_long_name =~ m/$_/ixms } @inclusions; # spent 118µs making 141 calls to List::MoreUtils::any, avg 835ns/call |
| 300 | } | ||||
| 301 | |||||
| 302 | #----------------------------------------------------------------------------- | ||||
| 303 | |||||
| 304 | # spent 1.21ms (944µs+264µs) within Perl::Critic::Config::_policy_is_excluded which was called 141 times, avg 9µs/call:
# 141 times (944µs+264µs) by Perl::Critic::Config::_load_policies at line 245, avg 9µs/call | ||||
| 305 | 141 | 31µs | my ($self, $policy) = @_; | ||
| 306 | 141 | 44µs | my $policy_long_name = ref $policy; | ||
| 307 | 141 | 146µs | 141 | 171µs | my @exclusions = $self->exclude(); # spent 171µs making 141 calls to Perl::Critic::Config::exclude, avg 1µs/call |
| 308 | 141 | 714µs | 141 | 93µs | return any { $policy_long_name =~ m/$_/ixms } @exclusions; # spent 93µs making 141 calls to List::MoreUtils::any, avg 658ns/call |
| 309 | } | ||||
| 310 | |||||
| 311 | #----------------------------------------------------------------------------- | ||||
| 312 | |||||
| 313 | sub _policy_is_single_policy { | ||||
| 314 | my ($self, $policy) = @_; | ||||
| 315 | |||||
| 316 | my @patterns = $self->single_policy(); | ||||
| 317 | return if not @patterns; | ||||
| 318 | |||||
| 319 | my $policy_long_name = ref $policy; | ||||
| 320 | return any { $policy_long_name =~ m/$_/ixms } @patterns; | ||||
| 321 | } | ||||
| 322 | |||||
| 323 | #----------------------------------------------------------------------------- | ||||
| 324 | |||||
| 325 | sub _new_global_value_exception { | ||||
| 326 | my ($self, @args) = @_; | ||||
| 327 | |||||
| 328 | return | ||||
| 329 | Perl::Critic::Exception::Configuration::Option::Global::ParameterValue | ||||
| 330 | ->new(@args); | ||||
| 331 | } | ||||
| 332 | |||||
| 333 | #----------------------------------------------------------------------------- | ||||
| 334 | |||||
| 335 | sub _add_single_policy_exception_to { | ||||
| 336 | my ($self, $errors) = @_; | ||||
| 337 | |||||
| 338 | my $message_suffix = $EMPTY; | ||||
| 339 | my $patterns = join q{", "}, $self->single_policy(); | ||||
| 340 | |||||
| 341 | if (scalar $self->policies() == 0) { | ||||
| 342 | $message_suffix = | ||||
| 343 | q{did not match any policies (in combination with } | ||||
| 344 | . q{other policy restrictions).}; | ||||
| 345 | } | ||||
| 346 | else { | ||||
| 347 | $message_suffix = qq{matched multiple policies:\n\t}; | ||||
| 348 | $message_suffix .= join qq{,\n\t}, apply { chomp } sort $self->policies(); | ||||
| 349 | } | ||||
| 350 | |||||
| 351 | $errors->add_exception( | ||||
| 352 | $self->_new_global_value_exception( | ||||
| 353 | option_name => $SINGLE_POLICY_CONFIG_KEY, | ||||
| 354 | option_value => $patterns, | ||||
| 355 | message_suffix => $message_suffix, | ||||
| 356 | ) | ||||
| 357 | ); | ||||
| 358 | |||||
| 359 | return; | ||||
| 360 | } | ||||
| 361 | |||||
| 362 | #----------------------------------------------------------------------------- | ||||
| 363 | |||||
| 364 | # spent 71µs (58+13) within Perl::Critic::Config::_validate_and_save_regex which was called 3 times, avg 24µs/call:
# once (31µs+4µs) by Perl::Critic::Config::_init at line 80
# once (16µs+6µs) by Perl::Critic::Config::_init at line 86
# once (12µs+3µs) by Perl::Critic::Config::_init at line 83 | ||||
| 365 | 3 | 4µs | 1 | 1µs | my ($self, $option_name, $args_value, $default_value, $errors) = @_; # spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 366 | |||||
| 367 | 3 | 300ns | my $full_option_name; | ||
| 368 | 3 | 100ns | my $source; | ||
| 369 | 3 | 400ns | my @regexes; | ||
| 370 | |||||
| 371 | 3 | 400ns | if ($args_value) { | ||
| 372 | $full_option_name = "-$option_name"; | ||||
| 373 | |||||
| 374 | if (ref $args_value) { | ||||
| 375 | @regexes = @{ $args_value }; | ||||
| 376 | } | ||||
| 377 | else { | ||||
| 378 | @regexes = ( $args_value ); | ||||
| 379 | } | ||||
| 380 | } | ||||
| 381 | |||||
| 382 | 3 | 10µs | if (not @regexes) { | ||
| 383 | 3 | 900ns | $full_option_name = $option_name; | ||
| 384 | 3 | 6µs | 6 | 8µs | $source = $self->_profile()->source(); # spent 4µs making 3 calls to Perl::Critic::UserProfile::source, avg 1µs/call
# spent 4µs making 3 calls to Perl::Critic::Config::_profile, avg 1µs/call |
| 385 | |||||
| 386 | 3 | 2µs | if (ref $default_value) { | ||
| 387 | @regexes = @{ $default_value }; | ||||
| 388 | } | ||||
| 389 | elsif ($default_value) { | ||||
| 390 | @regexes = ( $default_value ); | ||||
| 391 | } | ||||
| 392 | } | ||||
| 393 | |||||
| 394 | 3 | 200ns | my $found_errors; | ||
| 395 | 3 | 2µs | foreach my $regex (@regexes) { | ||
| 396 | eval { qr/$regex/ixms } | ||||
| 397 | or do { | ||||
| 398 | my $cleaned_error = $EVAL_ERROR || '<unknown reason>'; | ||||
| 399 | $cleaned_error =~ | ||||
| 400 | s/ [ ] at [ ] .* Config [.] pm [ ] line [ ] \d+ [.] \n? \z/./xms; | ||||
| 401 | |||||
| 402 | $errors->add_exception( | ||||
| 403 | $self->_new_global_value_exception( | ||||
| 404 | option_name => $option_name, | ||||
| 405 | option_value => $regex, | ||||
| 406 | source => $source, | ||||
| 407 | message_suffix => qq{is not valid: $cleaned_error}, | ||||
| 408 | ) | ||||
| 409 | ); | ||||
| 410 | |||||
| 411 | $found_errors = 1; | ||||
| 412 | } | ||||
| 413 | } | ||||
| 414 | |||||
| 415 | 3 | 900ns | if (not $found_errors) { | ||
| 416 | 3 | 700ns | my $option_key = $option_name; | ||
| 417 | 3 | 11µs | 3 | 3µs | $option_key =~ s/ - /_/xmsg; # spent 3µs making 3 calls to Perl::Critic::Config::CORE:subst, avg 1µs/call |
| 418 | |||||
| 419 | 3 | 3µs | $self->{"_$option_key"} = \@regexes; | ||
| 420 | } | ||||
| 421 | |||||
| 422 | 3 | 8µs | return; | ||
| 423 | } | ||||
| 424 | |||||
| 425 | #----------------------------------------------------------------------------- | ||||
| 426 | |||||
| 427 | # spent 40µs (29+11) within Perl::Critic::Config::_validate_and_save_profile_strictness which was called:
# once (29µs+11µs) by Perl::Critic::Config::_init at line 74 | ||||
| 428 | 1 | 900ns | my ($self, $args_value, $errors) = @_; | ||
| 429 | |||||
| 430 | 1 | 200ns | my $option_name; | ||
| 431 | 1 | 100ns | my $source; | ||
| 432 | 1 | 200ns | my $profile_strictness; | ||
| 433 | |||||
| 434 | 1 | 500ns | if ($args_value) { | ||
| 435 | $option_name = '-profile-strictness'; | ||||
| 436 | $profile_strictness = $args_value; | ||||
| 437 | } | ||||
| 438 | else { | ||||
| 439 | 1 | 500ns | $option_name = 'profile-strictness'; | ||
| 440 | |||||
| 441 | 1 | 3µs | 1 | 2µs | my $profile = $self->_profile(); # spent 2µs making 1 call to Perl::Critic::Config::_profile |
| 442 | 1 | 2µs | 1 | 2µs | $source = $profile->source(); # spent 2µs making 1 call to Perl::Critic::UserProfile::source |
| 443 | 1 | 4µs | 2 | 4µs | $profile_strictness = $profile->options_processor()->profile_strictness(); # spent 3µs making 1 call to Perl::Critic::OptionsProcessor::profile_strictness
# spent 1µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 444 | } | ||||
| 445 | |||||
| 446 | 1 | 4µs | 1 | 2µs | if ( not $PROFILE_STRICTNESSES{$profile_strictness} ) { # spent 2µs making 1 call to Readonly::Hash::FETCH |
| 447 | $errors->add_exception( | ||||
| 448 | $self->_new_global_value_exception( | ||||
| 449 | option_name => $option_name, | ||||
| 450 | option_value => $profile_strictness, | ||||
| 451 | source => $source, | ||||
| 452 | message_suffix => q{is not one of "} | ||||
| 453 | . join ( q{", "}, (sort keys %PROFILE_STRICTNESSES) ) | ||||
| 454 | . q{".}, | ||||
| 455 | ) | ||||
| 456 | ); | ||||
| 457 | |||||
| 458 | $profile_strictness = $PROFILE_STRICTNESS_FATAL; | ||||
| 459 | } | ||||
| 460 | |||||
| 461 | 1 | 800ns | $self->{_profile_strictness} = $profile_strictness; | ||
| 462 | |||||
| 463 | 1 | 4µs | return; | ||
| 464 | } | ||||
| 465 | |||||
| 466 | #----------------------------------------------------------------------------- | ||||
| 467 | |||||
| 468 | # spent 56µs (28+27) within Perl::Critic::Config::_validate_and_save_verbosity which was called:
# once (28µs+27µs) by Perl::Critic::Config::_init at line 113 | ||||
| 469 | 1 | 800ns | my ($self, $args_value, $errors) = @_; | ||
| 470 | |||||
| 471 | 1 | 200ns | my $option_name; | ||
| 472 | 1 | 100ns | my $source; | ||
| 473 | 1 | 200ns | my $verbosity; | ||
| 474 | |||||
| 475 | 1 | 600ns | if ($args_value) { | ||
| 476 | $option_name = '-verbose'; | ||||
| 477 | $verbosity = $args_value; | ||||
| 478 | } | ||||
| 479 | else { | ||||
| 480 | 1 | 500ns | $option_name = 'verbose'; | ||
| 481 | |||||
| 482 | 1 | 1µs | 1 | 1µs | my $profile = $self->_profile(); # spent 1µs making 1 call to Perl::Critic::Config::_profile |
| 483 | 1 | 2µs | 1 | 1µs | $source = $profile->source(); # spent 1µs making 1 call to Perl::Critic::UserProfile::source |
| 484 | 1 | 4µs | 2 | 4µs | $verbosity = $profile->options_processor()->verbose(); # spent 2µs making 1 call to Perl::Critic::OptionsProcessor::verbose
# spent 2µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 485 | } | ||||
| 486 | |||||
| 487 | 1 | 6µs | 2 | 21µs | if ( # spent 11µs making 1 call to Perl::Critic::Utils::is_valid_numeric_verbosity
# spent 10µs making 1 call to Perl::Critic::Utils::is_integer |
| 488 | is_integer($verbosity) | ||||
| 489 | and not is_valid_numeric_verbosity($verbosity) | ||||
| 490 | ) { | ||||
| 491 | $errors->add_exception( | ||||
| 492 | $self->_new_global_value_exception( | ||||
| 493 | option_name => $option_name, | ||||
| 494 | option_value => $verbosity, | ||||
| 495 | source => $source, | ||||
| 496 | message_suffix => | ||||
| 497 | 'is not the number of one of the pre-defined verbosity formats.', | ||||
| 498 | ) | ||||
| 499 | ); | ||||
| 500 | } | ||||
| 501 | else { | ||||
| 502 | 1 | 700ns | $self->{_verbose} = $verbosity; | ||
| 503 | } | ||||
| 504 | |||||
| 505 | 1 | 4µs | return; | ||
| 506 | } | ||||
| 507 | |||||
| 508 | #----------------------------------------------------------------------------- | ||||
| 509 | |||||
| 510 | # spent 42µs (30+13) within Perl::Critic::Config::_validate_and_save_severity which was called:
# once (30µs+13µs) by Perl::Critic::Config::_init at line 114 | ||||
| 511 | 1 | 400ns | my ($self, $args_value, $errors) = @_; | ||
| 512 | |||||
| 513 | 1 | 100ns | my $option_name; | ||
| 514 | 1 | 100ns | my $source; | ||
| 515 | 1 | 100ns | my $severity; | ||
| 516 | |||||
| 517 | 1 | 600ns | if ($args_value) { | ||
| 518 | $option_name = '-severity'; | ||||
| 519 | $severity = $args_value; | ||||
| 520 | } | ||||
| 521 | else { | ||||
| 522 | 1 | 400ns | $option_name = 'severity'; | ||
| 523 | |||||
| 524 | 1 | 1µs | 1 | 1µs | my $profile = $self->_profile(); # spent 1µs making 1 call to Perl::Critic::Config::_profile |
| 525 | 1 | 1µs | 1 | 1µs | $source = $profile->source(); # spent 1µs making 1 call to Perl::Critic::UserProfile::source |
| 526 | 1 | 4µs | 2 | 4µs | $severity = $profile->options_processor()->severity(); # spent 2µs making 1 call to Perl::Critic::OptionsProcessor::severity
# spent 1µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 527 | } | ||||
| 528 | |||||
| 529 | 1 | 7µs | 3 | 7µs | if ( is_integer($severity) ) { # spent 4µs making 1 call to Perl::Critic::Utils::is_integer
# spent 2µs making 2 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 530 | if ( | ||||
| 531 | $severity >= $SEVERITY_LOWEST and $severity <= $SEVERITY_HIGHEST | ||||
| 532 | ) { | ||||
| 533 | $self->{_severity} = $severity; | ||||
| 534 | } | ||||
| 535 | else { | ||||
| 536 | $errors->add_exception( | ||||
| 537 | $self->_new_global_value_exception( | ||||
| 538 | option_name => $option_name, | ||||
| 539 | option_value => $severity, | ||||
| 540 | source => $source, | ||||
| 541 | message_suffix => | ||||
| 542 | "is not between $SEVERITY_LOWEST (low) and $SEVERITY_HIGHEST (high).", | ||||
| 543 | ) | ||||
| 544 | ); | ||||
| 545 | } | ||||
| 546 | } | ||||
| 547 | elsif ( not any { $_ eq lc $severity } @SEVERITY_NAMES ) { | ||||
| 548 | $errors->add_exception( | ||||
| 549 | $self->_new_global_value_exception( | ||||
| 550 | option_name => $option_name, | ||||
| 551 | option_value => $severity, | ||||
| 552 | source => $source, | ||||
| 553 | message_suffix => | ||||
| 554 | q{is not one of the valid severity names: "} | ||||
| 555 | . join (q{", "}, @SEVERITY_NAMES) | ||||
| 556 | . q{".}, | ||||
| 557 | ) | ||||
| 558 | ); | ||||
| 559 | } | ||||
| 560 | else { | ||||
| 561 | $self->{_severity} = severity_to_number($severity); | ||||
| 562 | } | ||||
| 563 | |||||
| 564 | 1 | 3µs | return; | ||
| 565 | } | ||||
| 566 | |||||
| 567 | #----------------------------------------------------------------------------- | ||||
| 568 | |||||
| 569 | # spent 32µs (22+10) within Perl::Critic::Config::_validate_and_save_top which was called:
# once (22µs+10µs) by Perl::Critic::Config::_init at line 115 | ||||
| 570 | 1 | 800ns | my ($self, $args_value, $errors) = @_; | ||
| 571 | |||||
| 572 | 1 | 200ns | my $option_name; | ||
| 573 | 1 | 0s | my $source; | ||
| 574 | 1 | 200ns | my $top; | ||
| 575 | |||||
| 576 | 1 | 700ns | if (defined $args_value and $args_value ne q{}) { | ||
| 577 | $option_name = '-top'; | ||||
| 578 | $top = $args_value; | ||||
| 579 | } | ||||
| 580 | else { | ||||
| 581 | 1 | 500ns | $option_name = 'top'; | ||
| 582 | |||||
| 583 | 1 | 1µs | 1 | 1µs | my $profile = $self->_profile(); # spent 1µs making 1 call to Perl::Critic::Config::_profile |
| 584 | 1 | 1µs | 1 | 1µs | $source = $profile->source(); # spent 1µs making 1 call to Perl::Critic::UserProfile::source |
| 585 | 1 | 4µs | 2 | 4µs | $top = $profile->options_processor()->top(); # spent 2µs making 1 call to Perl::Critic::OptionsProcessor::top
# spent 1µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 586 | } | ||||
| 587 | |||||
| 588 | 1 | 2µs | 1 | 4µs | if ( is_integer($top) and $top >= 0 ) { # spent 4µs making 1 call to Perl::Critic::Utils::is_integer |
| 589 | $self->{_top} = $top; | ||||
| 590 | } | ||||
| 591 | else { | ||||
| 592 | $errors->add_exception( | ||||
| 593 | $self->_new_global_value_exception( | ||||
| 594 | option_name => $option_name, | ||||
| 595 | option_value => $top, | ||||
| 596 | source => $source, | ||||
| 597 | message_suffix => q{is not a non-negative integer.}, | ||||
| 598 | ) | ||||
| 599 | ); | ||||
| 600 | } | ||||
| 601 | |||||
| 602 | 1 | 3µs | return; | ||
| 603 | } | ||||
| 604 | |||||
| 605 | #----------------------------------------------------------------------------- | ||||
| 606 | |||||
| 607 | # spent 161µs (66+96) within Perl::Critic::Config::_validate_and_save_theme which was called:
# once (66µs+96µs) by Perl::Critic::Config::_init at line 116 | ||||
| 608 | 1 | 700ns | my ($self, $args_value, $errors) = @_; | ||
| 609 | |||||
| 610 | 1 | 200ns | my $option_name; | ||
| 611 | 1 | 100ns | my $source; | ||
| 612 | 1 | 100ns | my $theme_rule; | ||
| 613 | |||||
| 614 | 1 | 500ns | if ($args_value) { | ||
| 615 | $option_name = '-theme'; | ||||
| 616 | $theme_rule = $args_value; | ||||
| 617 | } | ||||
| 618 | else { | ||||
| 619 | 1 | 500ns | $option_name = 'theme'; | ||
| 620 | |||||
| 621 | 1 | 1µs | 1 | 1µs | my $profile = $self->_profile(); # spent 1µs making 1 call to Perl::Critic::Config::_profile |
| 622 | 1 | 1µs | 1 | 1µs | $source = $profile->source(); # spent 1µs making 1 call to Perl::Critic::UserProfile::source |
| 623 | 1 | 3µs | 2 | 4µs | $theme_rule = $profile->options_processor()->theme(); # spent 2µs making 1 call to Perl::Critic::OptionsProcessor::theme
# spent 1µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 624 | } | ||||
| 625 | |||||
| 626 | 1 | 13µs | 3 | 10µs | if ( $theme_rule =~ m/$RULE_INVALID_CHARACTER_REGEX/xms ) { # spent 8µs making 1 call to Perl::Critic::Config::CORE:regcomp
# spent 1µs making 1 call to Readonly::Scalar::FETCH
# spent 300ns making 1 call to Perl::Critic::Config::CORE:match |
| 627 | my $bad_character = $1; | ||||
| 628 | |||||
| 629 | $errors->add_exception( | ||||
| 630 | $self->_new_global_value_exception( | ||||
| 631 | option_name => $option_name, | ||||
| 632 | option_value => $theme_rule, | ||||
| 633 | source => $source, | ||||
| 634 | message_suffix => | ||||
| 635 | qq{contains an illegal character ("$bad_character").}, | ||||
| 636 | ) | ||||
| 637 | ); | ||||
| 638 | } | ||||
| 639 | else { | ||||
| 640 | 1 | 2µs | 1 | 28µs | my $rule_as_code = cook_rule($theme_rule); # spent 28µs making 1 call to Perl::Critic::Theme::cook_rule |
| 641 | 1 | 3µs | 1 | 300ns | $rule_as_code =~ s/ [\w\d]+ / 1 /gxms; # spent 300ns making 1 call to Perl::Critic::Config::CORE:subst |
| 642 | |||||
| 643 | # eval of an empty string does not reset $@ in Perl 5.6. | ||||
| 644 | 1 | 3µs | 1 | 1µs | local $EVAL_ERROR = $EMPTY; # spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 645 | 1 | 19µs | eval $rule_as_code; ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) | ||
| 646 | |||||
| 647 | 1 | 700ns | if ($EVAL_ERROR) { | ||
| 648 | $errors->add_exception( | ||||
| 649 | $self->_new_global_value_exception( | ||||
| 650 | option_name => $option_name, | ||||
| 651 | option_value => $theme_rule, | ||||
| 652 | source => $source, | ||||
| 653 | message_suffix => q{is not syntactically valid.}, | ||||
| 654 | ) | ||||
| 655 | ); | ||||
| 656 | } | ||||
| 657 | else { | ||||
| 658 | eval { | ||||
| 659 | 1 | 6µs | 1 | 52µs | $self->{_theme} = # spent 52µs making 1 call to Perl::Critic::Theme::new |
| 660 | Perl::Critic::Theme->new( -rule => $theme_rule ); | ||||
| 661 | } | ||||
| 662 | 1 | 700ns | or do { | ||
| 663 | $errors->add_exception_or_rethrow( $EVAL_ERROR ); | ||||
| 664 | }; | ||||
| 665 | } | ||||
| 666 | } | ||||
| 667 | |||||
| 668 | 1 | 3µs | return; | ||
| 669 | } | ||||
| 670 | |||||
| 671 | #----------------------------------------------------------------------------- | ||||
| 672 | |||||
| 673 | # spent 30µs (24+6) within Perl::Critic::Config::_validate_and_save_pager which was called:
# once (24µs+6µs) by Perl::Critic::Config::_init at line 117 | ||||
| 674 | 1 | 800ns | my ($self, $args_value, $errors) = @_; | ||
| 675 | |||||
| 676 | 1 | 200ns | my $pager; | ||
| 677 | 1 | 1µs | if ( $args_value ) { | ||
| 678 | $pager = defined $args_value ? $args_value : $EMPTY; | ||||
| 679 | } | ||||
| 680 | elsif ( $ENV{PERLCRITIC_PAGER} ) { | ||||
| 681 | $pager = $ENV{PERLCRITIC_PAGER}; | ||||
| 682 | } | ||||
| 683 | else { | ||||
| 684 | 1 | 1µs | 1 | 1µs | my $profile = $self->_profile(); # spent 1µs making 1 call to Perl::Critic::Config::_profile |
| 685 | 1 | 3µs | 2 | 4µs | $pager = $profile->options_processor()->pager(); # spent 2µs making 1 call to Perl::Critic::OptionsProcessor::pager
# spent 1µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 686 | } | ||||
| 687 | |||||
| 688 | 1 | 600ns | if ($pager eq '$PAGER') { ## no critic (RequireInterpolationOfMetachars) | ||
| 689 | $pager = $ENV{PAGER}; | ||||
| 690 | } | ||||
| 691 | 1 | 2µs | 1 | 1µs | $pager ||= $EMPTY; # spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 692 | |||||
| 693 | 1 | 800ns | $self->{_pager} = $pager; | ||
| 694 | |||||
| 695 | 1 | 3µs | return; | ||
| 696 | } | ||||
| 697 | |||||
| 698 | #----------------------------------------------------------------------------- | ||||
| 699 | |||||
| 700 | # spent 6.17ms (5.33+840µs) within Perl::Critic::Config::_validate_and_save_color_severity which was called 5 times, avg 1.23ms/call:
# once (5.23ms+731µs) by Perl::Critic::Config::_init at line 92
# once (30µs+36µs) by Perl::Critic::Config::_init at line 96
# once (24µs+25µs) by Perl::Critic::Config::_init at line 100
# once (23µs+24µs) by Perl::Critic::Config::_init at line 104
# once (22µs+24µs) by Perl::Critic::Config::_init at line 108 | ||||
| 701 | 5 | 5µs | my ($self, $option_name, $args_value, $default_value, $errors) = @_; | ||
| 702 | |||||
| 703 | 5 | 300ns | my $source; | ||
| 704 | 5 | 200ns | my $color_severity; | ||
| 705 | 5 | 200ns | my $full_option_name; | ||
| 706 | |||||
| 707 | 5 | 1µs | if (defined $args_value) { | ||
| 708 | $full_option_name = "-$option_name"; | ||||
| 709 | $color_severity = lc $args_value; | ||||
| 710 | } | ||||
| 711 | else { | ||||
| 712 | 5 | 800ns | $full_option_name = $option_name; | ||
| 713 | 5 | 12µs | 10 | 14µs | $source = $self->_profile()->source(); # spent 8µs making 5 calls to Perl::Critic::UserProfile::source, avg 2µs/call
# spent 6µs making 5 calls to Perl::Critic::Config::_profile, avg 1µs/call |
| 714 | 5 | 3µs | $color_severity = lc $default_value; | ||
| 715 | } | ||||
| 716 | 5 | 12µs | 5 | 4µs | $color_severity =~ s/ \s+ / /xmsg; # spent 4µs making 5 calls to Perl::Critic::Config::CORE:subst, avg 760ns/call |
| 717 | 5 | 11µs | 5 | 4µs | $color_severity =~ s/ \A\s+ //xms; # spent 4µs making 5 calls to Perl::Critic::Config::CORE:subst, avg 720ns/call |
| 718 | 5 | 10µs | 5 | 3µs | $color_severity =~ s/ \s+\z //xms; # spent 3µs making 5 calls to Perl::Critic::Config::CORE:subst, avg 680ns/call |
| 719 | 5 | 17µs | 5 | 9µs | $full_option_name =~ s/ _ /-/xmsg; # spent 9µs making 5 calls to Perl::Critic::Config::CORE:subst, avg 2µs/call |
| 720 | |||||
| 721 | # Should we really be validating this? | ||||
| 722 | 5 | 500ns | my $found_errors; | ||
| 723 | 5 | 15µs | 10 | 35µs | if ( # spent 23µs making 5 calls to Term::ANSIColor::colorvalid, avg 5µs/call
# spent 12µs making 5 calls to Perl::Critic::Utils::words_from_string, avg 2µs/call |
| 724 | eval { | ||||
| 725 | 5 | 110µs | require Term::ANSIColor; | ||
| 726 | 5 | 88µs | 20 | 119µs | Term::ANSIColor->VERSION( $_MODULE_VERSION_TERM_ANSICOLOR ); # spent 101µs making 5 calls to UNIVERSAL::VERSION, avg 20µs/call
# spent 18µs making 15 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 727 | 5 | 2µs | 1; | ||
| 728 | } | ||||
| 729 | ) { | ||||
| 730 | $found_errors = | ||||
| 731 | not Term::ANSIColor::colorvalid( words_from_string($color_severity) ); | ||||
| 732 | } | ||||
| 733 | |||||
| 734 | # If we do not have Term::ANSIColor we can not validate, but we store the | ||||
| 735 | # values anyway for the benefit of Perl::Critic::ProfilePrototype. | ||||
| 736 | |||||
| 737 | 5 | 800ns | if ($found_errors) { | ||
| 738 | $errors->add_exception( | ||||
| 739 | $self->_new_global_value_exception( | ||||
| 740 | option_name => $full_option_name, | ||||
| 741 | option_value => $color_severity, | ||||
| 742 | source => $source, | ||||
| 743 | message_suffix => 'is not valid.', | ||||
| 744 | ) | ||||
| 745 | ); | ||||
| 746 | } | ||||
| 747 | else { | ||||
| 748 | 5 | 1µs | my $option_key = $option_name; | ||
| 749 | 5 | 12µs | 5 | 4µs | $option_key =~ s/ - /_/xmsg; # spent 4µs making 5 calls to Perl::Critic::Config::CORE:subst, avg 720ns/call |
| 750 | |||||
| 751 | 5 | 7µs | $self->{"_$option_key"} = $color_severity; | ||
| 752 | } | ||||
| 753 | |||||
| 754 | 5 | 15µs | return; | ||
| 755 | } | ||||
| 756 | |||||
| 757 | #----------------------------------------------------------------------------- | ||||
| 758 | |||||
| 759 | # spent 31µs (24+7) within Perl::Critic::Config::_validate_and_save_program_extensions which was called:
# once (24µs+7µs) by Perl::Critic::Config::_init at line 118 | ||||
| 760 | 1 | 800ns | my ($self, $args_value, $errors) = @_; | ||
| 761 | |||||
| 762 | 1 | 900ns | delete $self->{_program_extensions_as_regexes}; | ||
| 763 | |||||
| 764 | my $extension_list = q{ARRAY} eq ref $args_value ? | ||||
| 765 | 1 | 5µs | 3 | 4µs | [map {words_from_string($_)} @{ $args_value }] : # spent 2µs making 1 call to Perl::Critic::OptionsProcessor::program_extensions
# spent 1µs making 1 call to Perl::Critic::Config::_profile
# spent 1µs making 1 call to Perl::Critic::UserProfile::options_processor |
| 766 | $self->_profile()->options_processor()->program_extensions(); | ||||
| 767 | |||||
| 768 | 1 | 3µs | 1 | 2µs | my %program_extensions = hashify( @{ $extension_list } ); # spent 2µs making 1 call to Perl::Critic::Utils::hashify |
| 769 | |||||
| 770 | 1 | 2µs | $self->{_program_extensions} = [keys %program_extensions]; | ||
| 771 | |||||
| 772 | 1 | 3µs | return; | ||
| 773 | |||||
| 774 | } | ||||
| 775 | |||||
| 776 | #----------------------------------------------------------------------------- | ||||
| 777 | # Begin ACCESSSOR methods | ||||
| 778 | |||||
| 779 | # spent 317µs within Perl::Critic::Config::_profile which was called 297 times, avg 1µs/call:
# 141 times (151µs+0s) by Perl::Critic::Config::_policy_is_disabled at line 264, avg 1µs/call
# 141 times (148µs+0s) by Perl::Critic::Config::_policy_is_enabled at line 272, avg 1µs/call
# 5 times (6µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 713, avg 1µs/call
# 3 times (4µs+0s) by Perl::Critic::Config::_validate_and_save_regex at line 384, avg 1µs/call
# once (2µs+0s) by Perl::Critic::Config::_validate_and_save_profile_strictness at line 441
# once (1µs+0s) by Perl::Critic::Config::_validate_and_save_top at line 583
# once (1µs+0s) by Perl::Critic::Config::_validate_and_save_program_extensions at line 765
# once (1µs+0s) by Perl::Critic::Config::_validate_and_save_severity at line 524
# once (1µs+0s) by Perl::Critic::Config::_validate_and_save_verbosity at line 482
# once (1µs+0s) by Perl::Critic::Config::_validate_and_save_theme at line 621
# once (1µs+0s) by Perl::Critic::Config::_validate_and_save_pager at line 684 | ||||
| 780 | 297 | 33µs | my ($self) = @_; | ||
| 781 | 297 | 590µs | return $self->{_profile}; | ||
| 782 | } | ||||
| 783 | |||||
| 784 | #----------------------------------------------------------------------------- | ||||
| 785 | |||||
| 786 | sub all_policies_enabled_or_not { | ||||
| 787 | my ($self) = @_; | ||||
| 788 | return @{ $self->{_all_policies_enabled_or_not} }; | ||||
| 789 | } | ||||
| 790 | |||||
| 791 | #----------------------------------------------------------------------------- | ||||
| 792 | |||||
| 793 | # spent 1.07ms within Perl::Critic::Config::policies which was called 289 times, avg 4µs/call:
# 145 times (430µs+0s) by Perl::Critic::policies at line 68 of Perl/Critic.pm, avg 3µs/call
# 144 times (643µs+0s) by Perl::Critic::_gather_violations at line 133 of Perl/Critic.pm, avg 4µs/call | ||||
| 794 | 289 | 106µs | my ($self) = @_; | ||
| 795 | 289 | 1.19ms | return @{ $self->{_policies} }; | ||
| 796 | } | ||||
| 797 | |||||
| 798 | #----------------------------------------------------------------------------- | ||||
| 799 | |||||
| 800 | # spent 171µs within Perl::Critic::Config::exclude which was called 141 times, avg 1µs/call:
# 141 times (171µs+0s) by Perl::Critic::Config::_policy_is_excluded at line 307, avg 1µs/call | ||||
| 801 | 141 | 23µs | my ($self) = @_; | ||
| 802 | 141 | 274µs | return @{ $self->{_exclude} }; | ||
| 803 | } | ||||
| 804 | |||||
| 805 | #----------------------------------------------------------------------------- | ||||
| 806 | |||||
| 807 | # spent 342µs within Perl::Critic::Config::force which was called 144 times, avg 2µs/call:
# 144 times (342µs+0s) by Perl::Critic::_gather_violations at line 128 of Perl/Critic.pm, avg 2µs/call | ||||
| 808 | 144 | 53µs | my ($self) = @_; | ||
| 809 | 144 | 392µs | return $self->{_force}; | ||
| 810 | } | ||||
| 811 | |||||
| 812 | #----------------------------------------------------------------------------- | ||||
| 813 | |||||
| 814 | # spent 184µs within Perl::Critic::Config::include which was called 141 times, avg 1µs/call:
# 141 times (184µs+0s) by Perl::Critic::Config::_policy_is_included at line 298, avg 1µs/call | ||||
| 815 | 141 | 20µs | my ($self) = @_; | ||
| 816 | 141 | 287µs | return @{ $self->{_include} }; | ||
| 817 | } | ||||
| 818 | |||||
| 819 | #----------------------------------------------------------------------------- | ||||
| 820 | |||||
| 821 | # spent 193µs within Perl::Critic::Config::only which was called 141 times, avg 1µs/call:
# 141 times (193µs+0s) by Perl::Critic::Config::_load_policies at line 237, avg 1µs/call | ||||
| 822 | 141 | 25µs | my ($self) = @_; | ||
| 823 | 141 | 267µs | return $self->{_only}; | ||
| 824 | } | ||||
| 825 | |||||
| 826 | #----------------------------------------------------------------------------- | ||||
| 827 | |||||
| 828 | # spent 2µs within Perl::Critic::Config::profile_strictness which was called:
# once (2µs+0s) by Perl::Critic::Config::_init at line 137 | ||||
| 829 | 1 | 400ns | my ($self) = @_; | ||
| 830 | 1 | 3µs | return $self->{_profile_strictness}; | ||
| 831 | } | ||||
| 832 | |||||
| 833 | #----------------------------------------------------------------------------- | ||||
| 834 | |||||
| 835 | sub severity { | ||||
| 836 | my ($self) = @_; | ||||
| 837 | return $self->{_severity}; | ||||
| 838 | } | ||||
| 839 | |||||
| 840 | #----------------------------------------------------------------------------- | ||||
| 841 | |||||
| 842 | sub single_policy { | ||||
| 843 | 142 | 27µs | my ($self) = @_; | ||
| 844 | 142 | 3.82ms | return @{ $self->{_single_policy} }; | ||
| 845 | } | ||||
| 846 | |||||
| 847 | #----------------------------------------------------------------------------- | ||||
| 848 | |||||
| 849 | # spent 154µs within Perl::Critic::Config::theme which was called 141 times, avg 1µs/call:
# 141 times (154µs+0s) by Perl::Critic::Config::_policy_is_thematic at line 280, avg 1µs/call | ||||
| 850 | 141 | 16µs | my ($self) = @_; | ||
| 851 | 141 | 272µs | return $self->{_theme}; | ||
| 852 | } | ||||
| 853 | |||||
| 854 | #----------------------------------------------------------------------------- | ||||
| 855 | |||||
| 856 | sub top { | ||||
| 857 | my ($self) = @_; | ||||
| 858 | return $self->{_top}; | ||||
| 859 | } | ||||
| 860 | |||||
| 861 | #----------------------------------------------------------------------------- | ||||
| 862 | |||||
| 863 | sub verbose { | ||||
| 864 | my ($self) = @_; | ||||
| 865 | return $self->{_verbose}; | ||||
| 866 | } | ||||
| 867 | |||||
| 868 | #----------------------------------------------------------------------------- | ||||
| 869 | |||||
| 870 | sub color { | ||||
| 871 | my ($self) = @_; | ||||
| 872 | return $self->{_color}; | ||||
| 873 | } | ||||
| 874 | |||||
| 875 | #----------------------------------------------------------------------------- | ||||
| 876 | |||||
| 877 | # spent 3µs within Perl::Critic::Config::pager which was called:
# once (3µs+0s) by Perl::Critic::Command::_critique at line 241 of Perl/Critic/Command.pm | ||||
| 878 | 1 | 400ns | my ($self) = @_; | ||
| 879 | 1 | 4µs | return $self->{_pager}; | ||
| 880 | } | ||||
| 881 | |||||
| 882 | #----------------------------------------------------------------------------- | ||||
| 883 | |||||
| 884 | sub unsafe_allowed { | ||||
| 885 | my ($self) = @_; | ||||
| 886 | return $self->{_unsafe_allowed}; | ||||
| 887 | } | ||||
| 888 | |||||
| 889 | #----------------------------------------------------------------------------- | ||||
| 890 | |||||
| 891 | sub criticism_fatal { | ||||
| 892 | my ($self) = @_; | ||||
| 893 | return $self->{_criticism_fatal}; | ||||
| 894 | } | ||||
| 895 | |||||
| 896 | #----------------------------------------------------------------------------- | ||||
| 897 | |||||
| 898 | sub site_policy_names { | ||||
| 899 | return Perl::Critic::PolicyFactory::site_policy_names(); | ||||
| 900 | } | ||||
| 901 | |||||
| 902 | #----------------------------------------------------------------------------- | ||||
| 903 | |||||
| 904 | sub color_severity_highest { | ||||
| 905 | my ($self) = @_; | ||||
| 906 | return $self->{_color_severity_highest}; | ||||
| 907 | } | ||||
| 908 | |||||
| 909 | #----------------------------------------------------------------------------- | ||||
| 910 | |||||
| 911 | sub color_severity_high { | ||||
| 912 | my ($self) = @_; | ||||
| 913 | return $self->{_color_severity_high}; | ||||
| 914 | } | ||||
| 915 | |||||
| 916 | #----------------------------------------------------------------------------- | ||||
| 917 | |||||
| 918 | sub color_severity_medium { | ||||
| 919 | my ($self) = @_; | ||||
| 920 | return $self->{_color_severity_medium}; | ||||
| 921 | } | ||||
| 922 | |||||
| 923 | #----------------------------------------------------------------------------- | ||||
| 924 | |||||
| 925 | sub color_severity_low { | ||||
| 926 | my ($self) = @_; | ||||
| 927 | return $self->{_color_severity_low}; | ||||
| 928 | } | ||||
| 929 | |||||
| 930 | #----------------------------------------------------------------------------- | ||||
| 931 | |||||
| 932 | sub color_severity_lowest { | ||||
| 933 | my ($self) = @_; | ||||
| 934 | return $self->{_color_severity_lowest}; | ||||
| 935 | } | ||||
| 936 | |||||
| 937 | #----------------------------------------------------------------------------- | ||||
| 938 | |||||
| 939 | # spent 3µs within Perl::Critic::Config::program_extensions which was called:
# once (3µs+0s) by Perl::Critic::Config::program_extensions_as_regexes at line 952 | ||||
| 940 | 1 | 400ns | my ($self) = @_; | ||
| 941 | 1 | 4µs | return @{ $self->{_program_extensions} }; | ||
| 942 | } | ||||
| 943 | |||||
| 944 | #----------------------------------------------------------------------------- | ||||
| 945 | |||||
| 946 | # spent 549µs (530+18) within Perl::Critic::Config::program_extensions_as_regexes which was called 144 times, avg 4µs/call:
# 144 times (530µs+18µs) by Perl::Critic::critique at line 104 of Perl/Critic.pm, avg 4µs/call | ||||
| 947 | 144 | 50µs | my ($self) = @_; | ||
| 948 | |||||
| 949 | 144 | 2.63ms | return @{ $self->{_program_extensions_as_regexes} } | ||
| 950 | if $self->{_program_extensions_as_regexes}; | ||||
| 951 | |||||
| 952 | 1 | 4µs | 2 | 4µs | my %program_extensions = hashify( $self->program_extensions() ); # spent 3µs making 1 call to Perl::Critic::Config::program_extensions
# spent 2µs making 1 call to Perl::Critic::Utils::hashify |
| 953 | 1 | 800ns | $program_extensions{'.PL'} = 1; | ||
| 954 | return @{ | ||||
| 955 | 1 | 4µs | $self->{_program_extensions_as_regexes} = [ | ||
| 956 | 2 | 32µs | 3 | 14µs | map { qr< @{[quotemeta $_]} \z >smx } sort keys %program_extensions # spent 11µs making 1 call to Perl::Critic::Config::CORE:regcomp
# spent 2µs making 1 call to Perl::Critic::Config::CORE:qr
# spent 1µs making 1 call to Perl::Critic::Config::CORE:sort |
| 957 | ] | ||||
| 958 | }; | ||||
| 959 | } | ||||
| 960 | |||||
| 961 | 1 | 3µs | 1; | ||
| 962 | |||||
| 963 | #----------------------------------------------------------------------------- | ||||
| 964 | |||||
| 965 | __END__ | ||||
# spent 300ns within Perl::Critic::Config::CORE:match which was called:
# once (300ns+0s) by Perl::Critic::Config::_validate_and_save_theme at line 626 | |||||
# spent 2µs within Perl::Critic::Config::CORE:qr which was called:
# once (2µs+0s) by Perl::Critic::Config::program_extensions_as_regexes at line 956 | |||||
sub Perl::Critic::Config::CORE:regcomp; # opcode | |||||
# spent 1µs within Perl::Critic::Config::CORE:sort which was called:
# once (1µs+0s) by Perl::Critic::Config::program_extensions_as_regexes at line 956 | |||||
# spent 27µs within Perl::Critic::Config::CORE:subst which was called 29 times, avg 934ns/call:
# 5 times (9µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 719, avg 2µs/call
# 5 times (4µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 716, avg 760ns/call
# 5 times (4µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 749, avg 720ns/call
# 5 times (4µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 717, avg 720ns/call
# 5 times (3µs+0s) by Perl::Critic::Config::_validate_and_save_color_severity at line 718, avg 680ns/call
# 3 times (3µs+0s) by Perl::Critic::Config::_validate_and_save_regex at line 417, avg 1µs/call
# once (300ns+0s) by Perl::Critic::Config::_validate_and_save_theme at line 641 |