| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/Subroutines/ProhibitNestedSubs.pm |
| Statements | Executed 90407 statements in 679ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 86181 | 1 | 1 | 316ms | 398ms | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::__ANON__[:46] |
| 1016 | 1 | 1 | 11.7ms | 1.34s | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::violates |
| 144 | 1 | 1 | 290µs | 290µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::applies_to |
| 1 | 1 | 1 | 16µs | 16µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@10 |
| 1 | 1 | 1 | 8µs | 12µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@12 |
| 1 | 1 | 1 | 8µs | 28µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@13 |
| 1 | 1 | 1 | 8µs | 19µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@11 |
| 1 | 1 | 1 | 7µs | 150µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@15 |
| 1 | 1 | 1 | 7µs | 62µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@16 |
| 1 | 1 | 1 | 5µs | 7µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::default_severity |
| 1 | 1 | 1 | 2µs | 2µs | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::supported_parameters |
| 0 | 0 | 0 | 0s | 0s | Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::default_themes |
| 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::ProhibitNestedSubs; | ||||
| 9 | |||||
| 10 | 2 | 39µs | 1 | 16µs | # spent 16µs within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::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::ProhibitNestedSubs::BEGIN@10 |
| 11 | 2 | 20µs | 2 | 30µs | # spent 19µs (8+11) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::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::ProhibitNestedSubs::BEGIN@11
# spent 11µs making 1 call to strict::import |
| 12 | 2 | 18µs | 2 | 16µs | # spent 12µs (8+4) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@12 which was called:
# once (8µs+4µs) by Module::Pluggable::Object::_require at line 12 # spent 12µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@12
# spent 4µs making 1 call to warnings::import |
| 13 | 2 | 26µs | 2 | 49µs | # spent 28µs (8+20) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::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::ProhibitNestedSubs::BEGIN@13
# spent 20µs making 1 call to Exporter::import |
| 14 | |||||
| 15 | 2 | 24µs | 2 | 294µs | # spent 150µs (7+143) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@15 which was called:
# once (7µs+143µs) by Module::Pluggable::Object::_require at line 15 # spent 150µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@15
# spent 143µs making 1 call to Exporter::import |
| 16 | 2 | 177µs | 2 | 116µs | # spent 62µs (7+54) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@16 which was called:
# once (7µs+54µs) by Module::Pluggable::Object::_require at line 16 # spent 62µs making 1 call to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::BEGIN@16
# spent 54µ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{Nested named subroutine}; # spent 28µs making 1 call to Readonly::Scalar |
| 23 | 1 | 900ns | 1 | 20µs | Readonly::Scalar my $EXPL => # spent 20µs making 1 call to Readonly::Scalar |
| 24 | q{Declaring a named sub inside another named sub does not prevent the } | ||||
| 25 | . q{inner sub from being global}; | ||||
| 26 | |||||
| 27 | #----------------------------------------------------------------------------- | ||||
| 28 | |||||
| 29 | 1 | 5µs | # spent 2µs within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::supported_parameters which was called:
# once (2µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||
| 30 | 1 | 1µs | # spent 7µs (5+1) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::default_severity which was called:
# once (5µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
| 31 | sub default_themes { return qw(core bugs) } | ||||
| 32 | 144 | 381µs | # spent 290µs within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::applies_to which was called 144 times, avg 2µs/call:
# 144 times (290µs+0s) by Perl::Critic::_critique at line 165 of Perl/Critic.pm, avg 2µs/call | ||
| 33 | |||||
| 34 | #----------------------------------------------------------------------------- | ||||
| 35 | |||||
| 36 | # spent 1.34s (11.7ms+1.33) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::violates which was called 1016 times, avg 1.32ms/call:
# 1016 times (11.7ms+1.33s) by Perl::Critic::_critique at line 183 of Perl/Critic.pm, avg 1.32ms/call | ||||
| 37 | 1016 | 380µs | my ($self, $elem, $doc) = @_; | ||
| 38 | |||||
| 39 | 1016 | 3.46ms | 1016 | 1.35ms | return if $elem->isa('PPI::Statement::Scheduled'); # spent 1.35ms making 1016 calls to UNIVERSAL::isa, avg 1µs/call |
| 40 | |||||
| 41 | my $inner = $elem->find_first( | ||||
| 42 | # spent 398ms (316+82.4) within Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/Subroutines/ProhibitNestedSubs.pm:46] which was called 86181 times, avg 5µs/call:
# 86181 times (316ms+82.4ms) by PPI::Node::find_first at line 438 of PPI/Node.pm, avg 5µs/call | ||||
| 43 | return | ||||
| 44 | 86181 | 664ms | 86181 | 82.4ms | $_[1]->isa('PPI::Statement::Sub') # spent 71.0ms making 83574 calls to UNIVERSAL::isa, avg 850ns/call
# spent 11.4ms making 2604 calls to PPI::Structure::List::isa, avg 4µs/call
# spent 17µs making 3 calls to PPI::Structure::For::isa, avg 6µs/call |
| 45 | && ! $_[1]->isa('PPI::Statement::Scheduled'); | ||||
| 46 | } | ||||
| 47 | 1016 | 4.15ms | 1016 | 1.32s | ); # spent 1.32s making 1016 calls to PPI::Node::find_first, avg 1.30ms/call |
| 48 | 1016 | 6.20ms | return if not $inner; | ||
| 49 | |||||
| 50 | # Must be a violation... | ||||
| 51 | return $self->violation($DESC, $EXPL, $inner); | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | 1 | 3µs | 1; | ||
| 55 | |||||
| 56 | __END__ |