Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/InputOutput/ProhibitBarewordFileHandles.pm |
Statements | Executed 27164 statements in 58.3ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
13481 | 1 | 1 | 49.1ms | 322ms | violates | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
144 | 1 | 1 | 298µs | 298µs | applies_to | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 26µs | 26µs | BEGIN@10 | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 16µs | 24µs | BEGIN@12 | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 15µs | 95µs | BEGIN@11 | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 12µs | 53µs | BEGIN@13 | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 12µs | 96µs | BEGIN@16 | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 11µs | 691µs | BEGIN@15 | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 9µs | 11µs | default_severity | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
1 | 1 | 1 | 2µs | 2µs | supported_parameters | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::
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::Policy::InputOutput::ProhibitBarewordFileHandles; | ||||
9 | |||||
10 | 2 | 68µs | 1 | 26µs | # spent 26µs within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@10 which was called:
# once (26µs+0s) by Module::Pluggable::Object::_require at line 10 # spent 26µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@10 |
11 | 2 | 55µs | 2 | 175µs | # spent 95µs (15+80) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@11 which was called:
# once (15µs+80µs) by Module::Pluggable::Object::_require at line 11 # spent 95µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@11
# spent 80µs making 1 call to strict::import |
12 | 2 | 34µs | 2 | 31µs | # spent 24µs (16+8) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@12 which was called:
# once (16µs+8µs) by Module::Pluggable::Object::_require at line 12 # spent 24µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@12
# spent 8µs making 1 call to warnings::import |
13 | 2 | 40µs | 2 | 93µs | # spent 53µs (12+40) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@13 which was called:
# once (12µs+40µs) by Module::Pluggable::Object::_require at line 13 # spent 53µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@13
# spent 40µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 40µs | 2 | 1.37ms | # spent 691µs (11+680) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@15 which was called:
# once (11µs+680µs) by Module::Pluggable::Object::_require at line 15 # spent 691µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@15
# spent 680µs making 1 call to Exporter::import |
16 | 2 | 308µs | 2 | 180µs | # spent 96µs (12+84) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@16 which was called:
# once (12µs+84µs) by Module::Pluggable::Object::_require at line 16 # spent 96µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::BEGIN@16
# spent 84µs making 1 call to base::import |
17 | |||||
18 | 1 | 1µs | our $VERSION = '1.121'; | ||
19 | |||||
20 | #----------------------------------------------------------------------------- | ||||
21 | |||||
22 | 1 | 3µs | 1 | 48µs | Readonly::Scalar my $DESC => q{Bareword file handle opened}; # spent 48µs making 1 call to Readonly::Scalar |
23 | 1 | 3µs | 1 | 73µs | Readonly::Scalar my $EXPL => [ 202, 204 ]; # spent 73µs making 1 call to Readonly::Scalar |
24 | |||||
25 | #----------------------------------------------------------------------------- | ||||
26 | |||||
27 | 1 | 6µs | # spent 2µs within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::supported_parameters which was called:
# once (2µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||
28 | 1 | 2µs | # spent 11µs (9+2) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::default_severity which was called:
# once (9µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
29 | sub default_themes { return qw( core pbp bugs certrec ) } | ||||
30 | 144 | 412µs | # spent 298µs within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::applies_to which was called 144 times, avg 2µs/call:
# 144 times (298µs+0s) by Perl::Critic::_critique at line 165 of Perl/Critic.pm, avg 2µs/call | ||
31 | |||||
32 | #----------------------------------------------------------------------------- | ||||
33 | |||||
34 | # spent 322ms (49.1+273) within Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::violates which was called 13481 times, avg 24µs/call:
# 13481 times (49.1ms+273ms) by Perl::Critic::_critique at line 183 of Perl/Critic.pm, avg 24µs/call | ||||
35 | 13481 | 3.01ms | my ($self, $elem, undef) = @_; | ||
36 | |||||
37 | 13481 | 54.3ms | 13481 | 269ms | return if $elem ne 'open'; # spent 269ms making 13481 calls to PPI::Element::__ne, avg 20µs/call |
38 | 6 | 13µs | 6 | 2.04ms | return if ! is_function_call($elem); # spent 2.04ms making 6 calls to Perl::Critic::Utils::is_function_call, avg 340µs/call |
39 | |||||
40 | 5 | 14µs | 5 | 2.46ms | my $first_arg = ( parse_arg_list($elem) )[0]; # spent 2.46ms making 5 calls to Perl::Critic::Utils::parse_arg_list, avg 492µs/call |
41 | 5 | 1µs | return if !$first_arg; | ||
42 | 5 | 2µs | my $first_token = $first_arg->[0]; | ||
43 | 5 | 16µs | 5 | 3µs | return if !$first_token; # spent 3µs making 5 calls to PPI::Util::TRUE, avg 680ns/call |
44 | |||||
45 | 5 | 19µs | 5 | 4µs | if ( $first_token->isa('PPI::Token::Word') ) { # spent 4µs making 5 calls to UNIVERSAL::isa, avg 880ns/call |
46 | 4 | 5µs | 4 | 64µs | if ( ($first_token ne 'my') && ($first_token !~ m/^STD(?:IN|OUT|ERR)$/xms ) ) { # spent 64µs making 4 calls to PPI::Element::__ne, avg 16µs/call |
47 | return $self->violation( $DESC, $EXPL, $elem ); | ||||
48 | } | ||||
49 | } | ||||
50 | 5 | 12µs | return; #ok! | ||
51 | } | ||||
52 | |||||
53 | 1 | 6µs | 1; | ||
54 | |||||
55 | __END__ |