| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/Modules/ProhibitEvilModules.pm |
| Statements | Executed 9042 statements in 7.11ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 982 | 1 | 1 | 6.11ms | 37.1ms | Perl::Critic::Policy::Modules::ProhibitEvilModules::violates |
| 144 | 1 | 1 | 305µs | 305µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::applies_to |
| 7 | 4 | 1 | 143µs | 155µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:regcomp (opcode) |
| 1 | 1 | 1 | 64µs | 186µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules |
| 4 | 1 | 1 | 29µs | 29µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::_handle_module_specification |
| 1 | 1 | 1 | 22µs | 26µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::supported_parameters |
| 5 | 2 | 1 | 18µs | 18µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:subst (opcode) |
| 1 | 1 | 1 | 16µs | 16µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@9 |
| 1 | 1 | 1 | 10µs | 30µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@17 |
| 1 | 1 | 1 | 8µs | 410µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@13 |
| 1 | 1 | 1 | 8µs | 74µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@22 |
| 1 | 1 | 1 | 8µs | 27µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@14 |
| 1 | 1 | 1 | 7µs | 11µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@11 |
| 1 | 1 | 1 | 7µs | 9µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::default_severity |
| 1 | 1 | 1 | 7µs | 471µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@18 |
| 1 | 1 | 1 | 7µs | 18µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@10 |
| 5 | 5 | 1 | 6µs | 6µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr (opcode) |
| 1 | 1 | 1 | 4µs | 4µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::initialize_if_enabled |
| 1 | 1 | 1 | 2µs | 2µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:match (opcode) |
| 1 | 1 | 1 | 2µs | 2µs | Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules_file |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Policy::Modules::ProhibitEvilModules::_handle_module_specification_on_line |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Policy::Modules::ProhibitEvilModules::default_themes |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | ############################################################################## | ||||
| 2 | # $URL$ | ||||
| 3 | # $Date$ | ||||
| 4 | # $Author$ | ||||
| 5 | # $Revision$ | ||||
| 6 | ############################################################################## | ||||
| 7 | package Perl::Critic::Policy::Modules::ProhibitEvilModules; | ||||
| 8 | |||||
| 9 | 2 | 40µs | 1 | 16µs | # spent 16µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@9 which was called:
# once (16µs+0s) by Module::Pluggable::Object::_require at line 9 # spent 16µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@9 |
| 10 | 2 | 22µs | 2 | 29µs | # spent 18µs (7+11) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@10 which was called:
# once (7µs+11µs) by Module::Pluggable::Object::_require at line 10 # spent 18µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@10
# spent 11µs making 1 call to strict::import |
| 11 | 2 | 21µs | 2 | 14µs | # spent 11µs (7+4) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@11 which was called:
# once (7µs+4µs) by Module::Pluggable::Object::_require at line 11 # spent 11µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@11
# spent 4µs making 1 call to warnings::import |
| 12 | |||||
| 13 | 2 | 24µs | 2 | 812µs | # spent 410µs (8+402) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@13 which was called:
# once (8µs+402µs) by Module::Pluggable::Object::_require at line 13 # spent 410µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@13
# spent 402µs making 1 call to English::import |
| 14 | 2 | 23µs | 2 | 46µs | # spent 27µs (8+19) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@14 which was called:
# once (8µs+19µs) by Module::Pluggable::Object::_require at line 14 # spent 27µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@14
# spent 19µs making 1 call to Exporter::import |
| 15 | |||||
| 16 | use Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue | ||||
| 17 | 2 | 25µs | 2 | 50µs | # spent 30µs (10+20) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@17 which was called:
# once (10µs+20µs) by Module::Pluggable::Object::_require at line 17 # spent 30µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@17
# spent 20µs making 1 call to Exporter::import |
| 18 | 1 | 200ns | # spent 471µs (7+464) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@18 which was called:
# once (7µs+464µs) by Module::Pluggable::Object::_require at line 20 | ||
| 19 | :booleans :characters :severities :data_conversion | ||||
| 20 | 1 | 24µs | 2 | 936µs | }; # spent 471µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@18
# spent 464µs making 1 call to Exporter::import |
| 21 | |||||
| 22 | 2 | 910µs | 2 | 141µs | # spent 74µs (8+66) within Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@22 which was called:
# once (8µs+66µs) by Module::Pluggable::Object::_require at line 22 # spent 74µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@22
# spent 66µs making 1 call to base::import |
| 23 | |||||
| 24 | 1 | 700ns | our $VERSION = '1.121'; | ||
| 25 | |||||
| 26 | #----------------------------------------------------------------------------- | ||||
| 27 | |||||
| 28 | 1 | 2µs | 1 | 33µs | Readonly::Scalar my $EXPL => q{Find an alternative module}; # spent 33µs making 1 call to Readonly::Scalar |
| 29 | |||||
| 30 | 1 | 7µs | 2 | 24µs | Readonly::Scalar my $MODULE_NAME_REGEX => # spent 23µs making 1 call to Readonly::Scalar
# spent 1µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr |
| 31 | qr< | ||||
| 32 | \b | ||||
| 33 | [[:alpha:]_] | ||||
| 34 | (?: | ||||
| 35 | (?: \w | :: )* | ||||
| 36 | \w | ||||
| 37 | )? | ||||
| 38 | \b | ||||
| 39 | >xms; | ||||
| 40 | 1 | 5µs | 2 | 22µs | Readonly::Scalar my $REGULAR_EXPRESSION_REGEX => qr< [/] ( [^/]+ ) [/] >xms; # spent 21µs making 1 call to Readonly::Scalar
# spent 1µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr |
| 41 | 1 | 4µs | 2 | 21µs | Readonly::Scalar my $DESCRIPTION_REGEX => qr< [{] ( [^}]+ ) [}] >xms; # spent 20µs making 1 call to Readonly::Scalar
# spent 1µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr |
| 42 | |||||
| 43 | # It's kind of unfortunate that I had to put capturing parentheses in the | ||||
| 44 | # component regexes above, because they're not visible here and so make | ||||
| 45 | # figuring out the positions of captures hard. Too bad we can't make the | ||||
| 46 | # minimum perl version 5.10. :] | ||||
| 47 | 1 | 48µs | 6 | 72µs | Readonly::Scalar my $MODULES_REGEX => # spent 44µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:regcomp
# spent 23µs making 1 call to Readonly::Scalar
# spent 4µs making 3 calls to Readonly::Scalar::FETCH, avg 1µs/call
# spent 1µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr |
| 48 | qr< | ||||
| 49 | \A | ||||
| 50 | \s* | ||||
| 51 | (?: | ||||
| 52 | ( $MODULE_NAME_REGEX ) | ||||
| 53 | | $REGULAR_EXPRESSION_REGEX | ||||
| 54 | ) | ||||
| 55 | (?: \s* $DESCRIPTION_REGEX )? | ||||
| 56 | \s* | ||||
| 57 | >xms; | ||||
| 58 | |||||
| 59 | 1 | 41µs | 5 | 65µs | Readonly::Scalar my $MODULES_FILE_LINE_REGEX => # spent 38µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:regcomp
# spent 23µs making 1 call to Readonly::Scalar
# spent 2µs making 2 calls to Readonly::Scalar::FETCH, avg 1µs/call
# spent 1µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr |
| 60 | qr< | ||||
| 61 | \A | ||||
| 62 | \s* | ||||
| 63 | (?: | ||||
| 64 | ( $MODULE_NAME_REGEX ) | ||||
| 65 | | $REGULAR_EXPRESSION_REGEX | ||||
| 66 | ) | ||||
| 67 | \s* | ||||
| 68 | ( \S (?: .* \S )? )? | ||||
| 69 | \s* | ||||
| 70 | \z | ||||
| 71 | >xms; | ||||
| 72 | |||||
| 73 | Readonly::Scalar my $DEFAULT_MODULES => | ||||
| 74 | join | ||||
| 75 | $SPACE, | ||||
| 76 | 1 | 8µs | 2 | 23µs | map { "$_ {Found use of $_. This module is deprecated by the Perl 5 Porters.}" } # spent 21µs making 1 call to Readonly::Scalar
# spent 2µs making 1 call to Readonly::Scalar::FETCH |
| 77 | qw< Class::ISA Pod::Plainer Shell Switch >; | ||||
| 78 | |||||
| 79 | # Indexes in the arrays of regexes for the "modules" option. | ||||
| 80 | 1 | 1µs | 1 | 20µs | Readonly::Scalar my $INDEX_REGEX => 0; # spent 20µs making 1 call to Readonly::Scalar |
| 81 | 1 | 900ns | 1 | 20µs | Readonly::Scalar my $INDEX_DESCRIPTION => 1; # spent 20µs making 1 call to Readonly::Scalar |
| 82 | |||||
| 83 | #----------------------------------------------------------------------------- | ||||
| 84 | |||||
| 85 | # spent 26µs (22+5) within Perl::Critic::Policy::Modules::ProhibitEvilModules::supported_parameters which was called:
# once (22µs+5µs) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||||
| 86 | return ( | ||||
| 87 | { | ||||
| 88 | 1 | 17µs | 4 | 5µs | name => 'modules', # spent 5µs making 4 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 89 | description => 'The names of or patterns for modules to forbid.', | ||||
| 90 | default_string => $DEFAULT_MODULES, | ||||
| 91 | parser => \&_parse_modules, | ||||
| 92 | }, | ||||
| 93 | { | ||||
| 94 | name => 'modules_file', | ||||
| 95 | description => 'A file containing names of or patterns for modules to forbid.', | ||||
| 96 | default_string => $EMPTY, | ||||
| 97 | parser => \&_parse_modules_file, | ||||
| 98 | }, | ||||
| 99 | ); | ||||
| 100 | } | ||||
| 101 | |||||
| 102 | 1 | 2µs | # spent 9µs (7+2) within Perl::Critic::Policy::Modules::ProhibitEvilModules::default_severity which was called:
# once (7µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
| 103 | sub default_themes { return qw( core bugs certrule ) } | ||||
| 104 | 144 | 379µs | # spent 305µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::applies_to which was called 144 times, avg 2µs/call:
# 144 times (305µs+0s) by Perl::Critic::_critique at line 165 of Perl/Critic.pm, avg 2µs/call | ||
| 105 | |||||
| 106 | #----------------------------------------------------------------------------- | ||||
| 107 | |||||
| 108 | # spent 186µs (64+122) within Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules which was called:
# once (64µs+122µs) by Perl::Critic::PolicyParameter::parse_and_validate_config_value at line 231 of Perl/Critic/PolicyParameter.pm | ||||
| 109 | 1 | 400ns | my ($self, $parameter, $config_string) = @_; | ||
| 110 | |||||
| 111 | 1 | 2µs | 1 | 1µs | my $module_specifications = # spent 1µs making 1 call to Perl::Critic::PolicyParameter::get_default_string |
| 112 | defined $config_string | ||||
| 113 | ? $config_string | ||||
| 114 | : $parameter->get_default_string(); | ||||
| 115 | |||||
| 116 | 1 | 300ns | return if not $module_specifications; | ||
| 117 | 1 | 8µs | 1 | 2µs | return if $module_specifications =~ m< \A \s* \z >xms; # spent 2µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:match |
| 118 | |||||
| 119 | 1 | 64µs | 3 | 58µs | while ( $module_specifications =~ s< $MODULES_REGEX ><>xms ) { # spent 50µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:regcomp
# spent 6µs making 1 call to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:subst
# spent 1µs making 1 call to Readonly::Scalar::FETCH |
| 120 | 4 | 6µs | my ($module, $regex_string, $description) = ($1, $2, $3); | ||
| 121 | |||||
| 122 | 4 | 48µs | 16 | 68µs | $self->_handle_module_specification( # spent 29µs making 4 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::_handle_module_specification, avg 7µs/call
# spent 23µs making 4 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:regcomp, avg 6µs/call
# spent 12µs making 4 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:subst, avg 3µs/call
# spent 5µs making 4 calls to Readonly::Scalar::FETCH, avg 1µs/call |
| 123 | module => $module, | ||||
| 124 | regex_string => $regex_string, | ||||
| 125 | description => $description, | ||||
| 126 | option_name => 'modules', | ||||
| 127 | option_value => $config_string, | ||||
| 128 | ); | ||||
| 129 | } | ||||
| 130 | |||||
| 131 | 1 | 200ns | if ($module_specifications) { | ||
| 132 | throw_policy_value | ||||
| 133 | policy => $self->get_short_name(), | ||||
| 134 | option_name => 'modules', | ||||
| 135 | option_value => $config_string, | ||||
| 136 | message_suffix => | ||||
| 137 | qq{contains unparseable data: "$module_specifications"}; | ||||
| 138 | } | ||||
| 139 | |||||
| 140 | 1 | 4µs | return; | ||
| 141 | } | ||||
| 142 | |||||
| 143 | # spent 2µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules_file which was called:
# once (2µs+0s) by Perl::Critic::PolicyParameter::parse_and_validate_config_value at line 231 of Perl/Critic/PolicyParameter.pm | ||||
| 144 | 1 | 400ns | my ($self, $parameter, $config_string) = @_; | ||
| 145 | |||||
| 146 | 1 | 4µs | return if not $config_string; | ||
| 147 | return if $config_string =~ m< \A \s* \z >xms; | ||||
| 148 | |||||
| 149 | open my $handle, '<', $config_string | ||||
| 150 | or throw_policy_value | ||||
| 151 | policy => $self->get_short_name(), | ||||
| 152 | option_name => 'modules_file', | ||||
| 153 | option_value => $config_string, | ||||
| 154 | message_suffix => | ||||
| 155 | qq<refers to a file that could not be opened: $OS_ERROR>; | ||||
| 156 | while ( my $line = <$handle> ) { | ||||
| 157 | $self->_handle_module_specification_on_line($line, $config_string); | ||||
| 158 | } | ||||
| 159 | close $handle or warn qq<Could not close "$config_string": $OS_ERROR\n>; | ||||
| 160 | |||||
| 161 | return; | ||||
| 162 | } | ||||
| 163 | |||||
| 164 | sub _handle_module_specification_on_line { | ||||
| 165 | my ($self, $line, $config_string) = @_; | ||||
| 166 | |||||
| 167 | $line =~ s< [#] .* \z ><>xms; | ||||
| 168 | $line =~ s< \s+ \z ><>xms; | ||||
| 169 | $line =~ s< \A \s+ ><>xms; | ||||
| 170 | |||||
| 171 | return if not $line; | ||||
| 172 | |||||
| 173 | if ( $line =~ s< $MODULES_FILE_LINE_REGEX ><>xms ) { | ||||
| 174 | my ($module, $regex_string, $description) = ($1, $2, $3); | ||||
| 175 | |||||
| 176 | $self->_handle_module_specification( | ||||
| 177 | module => $module, | ||||
| 178 | regex_string => $regex_string, | ||||
| 179 | description => $description, | ||||
| 180 | option_name => 'modules_file', | ||||
| 181 | option_value => $config_string, | ||||
| 182 | ); | ||||
| 183 | } | ||||
| 184 | else { | ||||
| 185 | throw_policy_value | ||||
| 186 | policy => $self->get_short_name(), | ||||
| 187 | option_name => 'modules_file', | ||||
| 188 | option_value => $config_string, | ||||
| 189 | message_suffix => | ||||
| 190 | qq{contains unparseable data: "$line"}; | ||||
| 191 | } | ||||
| 192 | |||||
| 193 | return; | ||||
| 194 | } | ||||
| 195 | |||||
| 196 | # spent 29µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::_handle_module_specification which was called 4 times, avg 7µs/call:
# 4 times (29µs+0s) by Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules at line 122, avg 7µs/call | ||||
| 197 | 4 | 9µs | my ($self, %arguments) = @_; | ||
| 198 | |||||
| 199 | 4 | 2µs | my $description = $arguments{description} || $EMPTY; | ||
| 200 | |||||
| 201 | 4 | 2µs | if ( my $regex_string = $arguments{regex_string} ) { | ||
| 202 | # These are module name patterns (e.g. /Acme/) | ||||
| 203 | my $actual_regex; | ||||
| 204 | |||||
| 205 | eval { $actual_regex = qr/$regex_string/; 1 } ## no critic (ExtendedFormatting, LineBoundaryMatching, DotMatchAnything) | ||||
| 206 | or throw_policy_value | ||||
| 207 | policy => $self->get_short_name(), | ||||
| 208 | option_name => $arguments{option_name}, | ||||
| 209 | option_value => $arguments{option_value}, | ||||
| 210 | message_suffix => | ||||
| 211 | qq{contains an invalid regular expression: "$regex_string"}; | ||||
| 212 | |||||
| 213 | # Can't use a hash due to stringification, so this is an AoA. | ||||
| 214 | $self->{_evil_modules_regexes} ||= []; | ||||
| 215 | |||||
| 216 | push | ||||
| 217 | @{ $self->{_evil_modules_regexes} }, | ||||
| 218 | [ $actual_regex, $description ]; | ||||
| 219 | } | ||||
| 220 | else { | ||||
| 221 | # These are literal module names (e.g. Acme::Foo) | ||||
| 222 | 4 | 2µs | $self->{_evil_modules} ||= {}; | ||
| 223 | 4 | 4µs | $self->{_evil_modules}{ $arguments{module} } = $description; | ||
| 224 | } | ||||
| 225 | |||||
| 226 | 4 | 13µs | return; | ||
| 227 | } | ||||
| 228 | |||||
| 229 | #----------------------------------------------------------------------------- | ||||
| 230 | |||||
| 231 | # spent 4µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::initialize_if_enabled which was called:
# once (4µs+0s) by Perl::Critic::Config::_add_policy_if_enabled at line 202 of Perl/Critic/Config.pm | ||||
| 232 | 1 | 400ns | my ($self, $config) = @_; | ||
| 233 | |||||
| 234 | # Disable if no modules are specified; there's no point in running if | ||||
| 235 | # there aren't any. | ||||
| 236 | return | ||||
| 237 | 1 | 6µs | exists $self->{_evil_modules} | ||
| 238 | || exists $self->{_evil_modules_regexes}; | ||||
| 239 | } | ||||
| 240 | |||||
| 241 | #----------------------------------------------------------------------------- | ||||
| 242 | |||||
| 243 | # spent 37.1ms (6.11+31.0) within Perl::Critic::Policy::Modules::ProhibitEvilModules::violates which was called 982 times, avg 38µs/call:
# 982 times (6.11ms+31.0ms) by Perl::Critic::_critique at line 183 of Perl/Critic.pm, avg 38µs/call | ||||
| 244 | 982 | 295µs | my ( $self, $elem, undef ) = @_; | ||
| 245 | |||||
| 246 | 982 | 1.39ms | 982 | 31.0ms | my $module = $elem->module(); # spent 31.0ms making 982 calls to PPI::Statement::Include::module, avg 32µs/call |
| 247 | 982 | 393µs | return if not $module; | ||
| 248 | |||||
| 249 | 840 | 324µs | my $evil_modules = $self->{_evil_modules}; | ||
| 250 | 840 | 185µs | my $evil_modules_regexes = $self->{_evil_modules_regexes}; | ||
| 251 | 840 | 25µs | my $description; | ||
| 252 | |||||
| 253 | 840 | 342µs | if ( exists $evil_modules->{$module} ) { | ||
| 254 | $description = $evil_modules->{ $module }; | ||||
| 255 | } | ||||
| 256 | else { | ||||
| 257 | REGEX: | ||||
| 258 | 840 | 564µs | foreach my $regex ( @{$evil_modules_regexes} ) { | ||
| 259 | if ( $module =~ $regex->[$INDEX_REGEX] ) { | ||||
| 260 | $description = $regex->[$INDEX_DESCRIPTION]; | ||||
| 261 | last REGEX; | ||||
| 262 | } | ||||
| 263 | } | ||||
| 264 | } | ||||
| 265 | |||||
| 266 | 840 | 109µs | if (defined $description) { | ||
| 267 | $description ||= qq<Prohibited module "$module" used>; | ||||
| 268 | |||||
| 269 | return $self->violation( $description, $EXPL, $elem ); | ||||
| 270 | } | ||||
| 271 | |||||
| 272 | 840 | 1.69ms | return; # ok! | ||
| 273 | } | ||||
| 274 | |||||
| 275 | 1 | 15µs | 1; | ||
| 276 | |||||
| 277 | __END__ | ||||
# spent 2µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:match which was called:
# once (2µs+0s) by Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules at line 117 | |||||
# spent 6µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:qr which was called 5 times, avg 1µs/call:
# once (1µs+0s) by Module::Pluggable::Object::_require at line 47
# once (1µs+0s) by Module::Pluggable::Object::_require at line 30
# once (1µs+0s) by Module::Pluggable::Object::_require at line 59
# once (1µs+0s) by Module::Pluggable::Object::_require at line 40
# once (1µs+0s) by Module::Pluggable::Object::_require at line 41 | |||||
# spent 155µs (143+12) within Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:regcomp which was called 7 times, avg 22µs/call:
# 4 times (18µs+5µs) by Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules at line 122, avg 6µs/call
# once (49µs+1µs) by Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules at line 119
# once (41µs+4µs) by Module::Pluggable::Object::_require at line 47
# once (36µs+2µs) by Module::Pluggable::Object::_require at line 59 | |||||
# spent 18µs within Perl::Critic::Policy::Modules::ProhibitEvilModules::CORE:subst which was called 5 times, avg 4µs/call:
# 4 times (12µs+0s) by Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules at line 122, avg 3µs/call
# once (6µs+0s) by Perl::Critic::Policy::Modules::ProhibitEvilModules::_parse_modules at line 119 |