← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:12 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/Documentation/RequirePodAtEnd.pm
StatementsExecuted 21 statements in 416µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs16µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@10Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@10
11113µs46µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@15Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@15
1119µs11µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::default_severityPerl::Critic::Policy::Documentation::RequirePodAtEnd::default_severity
1118µs12µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@12Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@12
1118µs154µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@17Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@17
1118µs19µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@11Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@11
1117µs58µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@18Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@18
1117µs28µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::BEGIN@13Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@13
1112µs2µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::supported_parametersPerl::Critic::Policy::Documentation::RequirePodAtEnd::supported_parameters
1112µs2µsPerl::Critic::Policy::Documentation::RequirePodAtEnd::::CORE:qrPerl::Critic::Policy::Documentation::RequirePodAtEnd::CORE:qr (opcode)
0000s0sPerl::Critic::Policy::Documentation::RequirePodAtEnd::::__ANON__[:45]Perl::Critic::Policy::Documentation::RequirePodAtEnd::__ANON__[:45]
0000s0sPerl::Critic::Policy::Documentation::RequirePodAtEnd::::applies_toPerl::Critic::Policy::Documentation::RequirePodAtEnd::applies_to
0000s0sPerl::Critic::Policy::Documentation::RequirePodAtEnd::::default_themesPerl::Critic::Policy::Documentation::RequirePodAtEnd::default_themes
0000s0sPerl::Critic::Policy::Documentation::RequirePodAtEnd::::violatesPerl::Critic::Policy::Documentation::RequirePodAtEnd::violates
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1##############################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6##############################################################################
7
8package Perl::Critic::Policy::Documentation::RequirePodAtEnd;
9
10244µs116µs
# spent 16µs within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@10 which was called: # once (16µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11221µs230µs
# spent 19µs (8+11) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@11 which was called: # once (8µs+11µs) by Module::Pluggable::Object::_require at line 11
use strict;
# spent 19µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@11 # spent 11µs making 1 call to strict::import
12218µs215µs
# spent 12µs (8+4) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@12 which was called: # once (8µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
# spent 12µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@12 # spent 4µs making 1 call to warnings::import
13222µs248µs
# spent 28µs (7+21) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@13 which was called: # once (7µs+21µs) by Module::Pluggable::Object::_require at line 13
use Readonly;
# spent 28µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@13 # spent 21µs making 1 call to Exporter::import
14
15226µs255µs
# spent 46µs (13+32) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@15 which was called: # once (13µs+32µs) by Module::Pluggable::Object::_require at line 15
use List::Util qw(first);
# spent 46µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@15 # spent 10µs making 1 call to List::Util::import
16
17222µs2300µs
# spent 154µs (8+146) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@17 which was called: # once (8µs+146µs) by Module::Pluggable::Object::_require at line 17
use Perl::Critic::Utils qw{ :severities };
# spent 154µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@17 # spent 146µs making 1 call to Exporter::import
182239µs2108µs
# spent 58µs (7+50) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@18 which was called: # once (7µs+50µs) by Module::Pluggable::Object::_require at line 18
use base 'Perl::Critic::Policy';
# spent 58µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::BEGIN@18 # spent 50µs making 1 call to base::import
19
201600nsour $VERSION = '1.121';
21
22#-----------------------------------------------------------------------------
23
24110µs240µsReadonly::Scalar my $POD_RX => qr{\A = (?: for|begin|end ) }xms;
# spent 38µs making 1 call to Readonly::Scalar # spent 2µs making 1 call to Perl::Critic::Policy::Documentation::RequirePodAtEnd::CORE:qr
2511µs122µsReadonly::Scalar my $DESC => q{POD before __END__};
# spent 22µs making 1 call to Readonly::Scalar
2612µs153µsReadonly::Scalar my $EXPL => [139, 140];
# spent 53µs making 1 call to Readonly::Scalar
27
28#-----------------------------------------------------------------------------
29
3015µs
# spent 2µs within Perl::Critic::Policy::Documentation::RequirePodAtEnd::supported_parameters which was called: # once (2µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm
sub supported_parameters { return () }
3112µs
# spent 11µs (9+2) within Perl::Critic::Policy::Documentation::RequirePodAtEnd::default_severity which was called: # once (9µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm
sub default_severity { return $SEVERITY_LOWEST }
32sub default_themes { return qw( core cosmetic pbp ) }
33sub applies_to { return 'PPI::Document' }
34
35#-----------------------------------------------------------------------------
36
37sub violates {
38 my ( $self, $elem, $doc ) = @_;
39
40 # No POD means no violation
41 my $pods_ref = $doc->find('PPI::Token::Pod');
42 return if !$pods_ref;
43
44 # Look for first POD tag that isn't =for, =begin, or =end
45 my $pod = first { $_ !~ $POD_RX} @{ $pods_ref };
46 return if !$pod;
47
48 my $end = $doc->find_first('PPI::Statement::End');
49 if ($end) { # No __END__ means definite violation
50 my $pod_loc = $pod->location();
51 my $end_loc = $end->location();
52 if ( $pod_loc->[0] > $end_loc->[0] ) {
53 # POD is after __END__, or relative position couldn't be determined
54 return;
55 }
56 }
57
58 return $self->violation( $DESC, $EXPL, $pod );
59}
60
6114µs1;
62
63__END__
 
# spent 2µs within Perl::Critic::Policy::Documentation::RequirePodAtEnd::CORE:qr which was called: # once (2µs+0s) by Module::Pluggable::Object::_require at line 24
sub Perl::Critic::Policy::Documentation::RequirePodAtEnd::CORE:qr; # opcode