Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/Subroutines/ProhibitReturnSort.pm |
Statements | Executed 36099 statements in 60.6ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
13481 | 1 | 1 | 79.5ms | 630ms | violates | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
144 | 1 | 1 | 303µs | 303µs | applies_to | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 16µs | 16µs | BEGIN@10 | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 8µs | 28µs | BEGIN@13 | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 8µs | 389µs | BEGIN@15 | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 8µs | 19µs | BEGIN@11 | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 8µs | 11µs | BEGIN@12 | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 7µs | 58µs | BEGIN@16 | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 6µs | 7µs | default_severity | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
1 | 1 | 1 | 2µs | 2µs | supported_parameters | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::Subroutines::ProhibitReturnSort::
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::Subroutines::ProhibitReturnSort; | ||||
9 | |||||
10 | 2 | 43µs | 1 | 16µs | # spent 16µs within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@10 which was called:
# once (16µs+0s) by Module::Pluggable::Object::_require at line 10 # spent 16µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@10 |
11 | 2 | 20µs | 2 | 30µs | # spent 19µs (8+11) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@11 which was called:
# once (8µs+11µs) by Module::Pluggable::Object::_require at line 11 # spent 19µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@11
# spent 11µs making 1 call to strict::import |
12 | 2 | 21µs | 2 | 15µs | # spent 11µs (8+4) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@12 which was called:
# once (8µs+4µs) by Module::Pluggable::Object::_require at line 12 # spent 11µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | 2 | 26µs | 2 | 48µs | # spent 28µs (8+20) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@13 which was called:
# once (8µs+20µs) by Module::Pluggable::Object::_require at line 13 # spent 28µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@13
# spent 20µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 24µs | 2 | 770µs | # spent 389µs (8+381) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@15 which was called:
# once (8µs+381µs) by Module::Pluggable::Object::_require at line 15 # spent 389µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::BEGIN@15
# spent 381µs making 1 call to Exporter::import |
16 | 2 | 156µs | 2 | 108µs | # spent 58µs (7+50) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::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::Subroutines::ProhibitReturnSort::BEGIN@16
# spent 50µs making 1 call to base::import |
17 | |||||
18 | 1 | 600ns | our $VERSION = '1.121'; | ||
19 | |||||
20 | #----------------------------------------------------------------------------- | ||||
21 | |||||
22 | 1 | 2µs | 1 | 28µs | Readonly::Scalar my $DESC => q{"return" statement followed by "sort"}; # spent 28µs making 1 call to Readonly::Scalar |
23 | 1 | 900ns | 1 | 20µs | Readonly::Scalar my $EXPL => q{Behavior is undefined if called in scalar context}; # spent 20µs making 1 call to Readonly::Scalar |
24 | |||||
25 | #----------------------------------------------------------------------------- | ||||
26 | |||||
27 | 1 | 4µs | # spent 2µs within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::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 7µs (6+1) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::default_severity which was called:
# once (6µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
29 | sub default_themes { return qw(core bugs certrule ) } | ||||
30 | 144 | 423µs | # spent 303µs within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::applies_to which was called 144 times, avg 2µs/call:
# 144 times (303µs+0s) by Perl::Critic::_critique at line 165 of Perl/Critic.pm, avg 2µs/call | ||
31 | |||||
32 | #----------------------------------------------------------------------------- | ||||
33 | |||||
34 | # spent 630ms (79.5+551) within Perl::Critic::Policy::Subroutines::ProhibitReturnSort::violates which was called 13481 times, avg 47µs/call:
# 13481 times (79.5ms+551ms) by Perl::Critic::_critique at line 183 of Perl/Critic.pm, avg 47µs/call | ||||
35 | 13481 | 3.26ms | my ( $self, $elem, undef ) = @_; | ||
36 | 13481 | 34.7ms | 13481 | 257ms | return if ($elem ne 'return'); # spent 257ms making 13481 calls to PPI::Element::__ne, avg 19µs/call |
37 | 2101 | 2.21ms | 2101 | 224ms | return if is_hash_key($elem); # spent 224ms making 2101 calls to Perl::Critic::Utils::is_hash_key, avg 106µs/call |
38 | |||||
39 | 2101 | 2.31ms | 2101 | 55.5ms | my $sib = $elem->snext_sibling(); # spent 55.5ms making 2101 calls to PPI::Element::snext_sibling, avg 26µs/call |
40 | 2101 | 7.45ms | 2099 | 1.24ms | return if !$sib; # spent 1.24ms making 2099 calls to PPI::Util::TRUE, avg 592ns/call |
41 | 2099 | 8.25ms | 2099 | 2.64ms | return if !$sib->isa('PPI::Token::Word'); # spent 1.91ms making 1944 calls to UNIVERSAL::isa, avg 981ns/call
# spent 732µs making 155 calls to PPI::Structure::List::isa, avg 5µs/call |
42 | 573 | 1.69ms | 573 | 11.3ms | return if $sib ne 'sort'; # spent 11.3ms making 573 calls to PPI::Element::__ne, avg 20µs/call |
43 | |||||
44 | # Must be 'return sort' | ||||
45 | return $self->violation( $DESC, $EXPL, $elem ); | ||||
46 | } | ||||
47 | |||||
48 | 1 | 3µs | 1; | ||
49 | |||||
50 | __END__ |