Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/BuiltinFunctions/ProhibitSleepViaSelect.pm |
Statements | Executed 27125 statements in 45.7ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
13481 | 1 | 1 | 49.5ms | 305ms | violates | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
144 | 1 | 1 | 320µs | 320µs | applies_to | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 17µs | 17µs | BEGIN@10 | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 10µs | 15µs | BEGIN@12 | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 7µs | 18µs | BEGIN@11 | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 7µs | 28µs | BEGIN@13 | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 7µs | 428µs | BEGIN@15 | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 7µs | 58µs | BEGIN@16 | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 7µs | 8µs | default_severity | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
1 | 1 | 1 | 2µs | 2µs | supported_parameters | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::
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::BuiltinFunctions::ProhibitSleepViaSelect; | ||||
9 | |||||
10 | 2 | 45µs | 1 | 17µs | # spent 17µs within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@10 which was called:
# once (17µs+0s) by Module::Pluggable::Object::_require at line 10 # spent 17µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@10 |
11 | 2 | 21µs | 2 | 30µs | # spent 18µs (7+11) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@11 which was called:
# once (7µs+11µs) by Module::Pluggable::Object::_require at line 11 # spent 18µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@11
# spent 11µs making 1 call to strict::import |
12 | 2 | 20µs | 2 | 19µs | # spent 15µs (10+5) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@12 which was called:
# once (10µs+5µs) by Module::Pluggable::Object::_require at line 12 # spent 15µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | 2 | 23µs | 2 | 48µs | # spent 28µs (7+21) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@13 which was called:
# once (7µs+21µs) by Module::Pluggable::Object::_require at line 13 # spent 28µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@13
# spent 21µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 24µs | 2 | 848µs | # spent 428µs (7+421) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@15 which was called:
# once (7µs+421µs) by Module::Pluggable::Object::_require at line 15 # spent 428µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@15
# spent 421µs making 1 call to Exporter::import |
16 | 2 | 188µs | 2 | 108µs | # spent 58µs (7+50) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@16 which was called:
# once (7µs+50µs) by Module::Pluggable::Object::_require at line 16 # spent 58µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::BEGIN@16
# spent 50µs making 1 call to base::import |
17 | |||||
18 | 1 | 500ns | our $VERSION = '1.121'; | ||
19 | |||||
20 | #----------------------------------------------------------------------------- | ||||
21 | |||||
22 | 1 | 2µs | 1 | 29µs | Readonly::Scalar my $DESC => q{"select" used to emulate "sleep"}; # spent 29µs making 1 call to Readonly::Scalar |
23 | 1 | 2µs | 1 | 42µs | Readonly::Scalar my $EXPL => [168]; # spent 42µs making 1 call to Readonly::Scalar |
24 | 1 | 800ns | 1 | 20µs | Readonly::Scalar my $SELECT_ARGUMENT_COUNT => 4; # spent 20µs making 1 call to Readonly::Scalar |
25 | |||||
26 | #----------------------------------------------------------------------------- | ||||
27 | |||||
28 | 1 | 4µs | # spent 2µs within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::supported_parameters which was called:
# once (2µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||
29 | 1 | 2µs | # spent 8µs (7+1) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::default_severity which was called:
# once (7µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
30 | sub default_themes { return qw( core pbp bugs ) } | ||||
31 | 144 | 416µs | # spent 320µs within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::applies_to which was called 144 times, avg 2µs/call:
# 144 times (320µs+0s) by Perl::Critic::_critique at line 165 of Perl/Critic.pm, avg 2µs/call | ||
32 | |||||
33 | #----------------------------------------------------------------------------- | ||||
34 | |||||
35 | # spent 305ms (49.5+255) within Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::violates which was called 13481 times, avg 23µs/call:
# 13481 times (49.5ms+255ms) by Perl::Critic::_critique at line 183 of Perl/Critic.pm, avg 23µs/call | ||||
36 | 13481 | 3.03ms | my ($self, $elem, undef) = @_; | ||
37 | |||||
38 | 13481 | 42.0ms | 13481 | 255ms | return if ($elem ne 'select'); # spent 255ms making 13481 calls to PPI::Element::__ne, avg 19µs/call |
39 | return if ! is_function_call($elem); | ||||
40 | |||||
41 | my @arguments = parse_arg_list($elem); | ||||
42 | return if $SELECT_ARGUMENT_COUNT != @arguments; | ||||
43 | |||||
44 | foreach my $argument ( @arguments[0..2] ) { | ||||
45 | return if $argument->[0] ne 'undef'; | ||||
46 | } | ||||
47 | |||||
48 | if ( $arguments[-1]->[0] ne 'undef' ) { | ||||
49 | return $self->violation( $DESC, $EXPL, $elem ); | ||||
50 | } | ||||
51 | |||||
52 | return; #ok! | ||||
53 | } | ||||
54 | |||||
55 | 1 | 3µs | 1; | ||
56 | |||||
57 | __END__ |