← 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:11 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/TestingAndDebugging/ProhibitProlongedStrictureOverride.pm
StatementsExecuted 18 statements in 338µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs18µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::BEGIN@10Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@10
1118µs29µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::BEGIN@13Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@13
1118µs20µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::BEGIN@11Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@11
1118µs11µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::BEGIN@12Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@12
1117µs150µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::BEGIN@15Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@15
1117µs59µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::BEGIN@16Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@16
1116µs7µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::default_severityPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::default_severity
1115µs5µsPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::supported_parametersPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::supported_parameters
0000s0sPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::applies_toPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::applies_to
0000s0sPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::default_themesPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::default_themes
0000s0sPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::::violatesPerl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::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::TestingAndDebugging::ProhibitProlongedStrictureOverride;
9
10242µs118µs
# spent 18µs within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@10 which was called: # once (18µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11221µs232µs
# spent 20µs (8+12) within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@11 which was called: # once (8µs+12µs) by Module::Pluggable::Object::_require at line 11
use strict;
12219µs215µs
# spent 11µs (8+4) within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@12 which was called: # once (8µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
13222µs250µs
# spent 29µs (8+21) within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@13 which was called: # once (8µs+21µs) by Module::Pluggable::Object::_require at line 13
use Readonly;
14
15227µs2292µs
# spent 150µs (7+142) within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@15 which was called: # once (7µs+142µs) by Module::Pluggable::Object::_require at line 15
use Perl::Critic::Utils qw{ :severities };
# spent 150µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@15 # spent 142µs making 1 call to Exporter::import
162190µs2110µs
# spent 59µs (7+52) within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@16 which was called: # once (7µs+52µs) by Module::Pluggable::Object::_require at line 16
use base 'Perl::Critic::Policy';
# spent 59µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@16 # spent 52µs making 1 call to base::import
17
181600nsour $VERSION = '1.121';
19
20#-----------------------------------------------------------------------------
21
2212µs128µsReadonly::Scalar my $DESC => q{Don't turn off strict for large blocks of code};
# spent 28µs making 1 call to Readonly::Scalar
2312µs142µsReadonly::Scalar my $EXPL => [ 433 ];
# spent 42µs making 1 call to Readonly::Scalar
24
25#-----------------------------------------------------------------------------
26
27
# spent 5µs within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::supported_parameters which was called: # once (5µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm
sub supported_parameters {
28 return (
29 {
3018µs name => 'statements',
31 description => 'The maximum number of statements in a no strict block.',
32 default_string => '3',
33 behavior => 'integer',
34 integer_minimum => 1,
35 },
36 );
37}
38
3912µs
# spent 7µs (6+1) within Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::default_severity which was called: # once (6µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm
sub default_severity { return $SEVERITY_HIGH }
40sub default_themes { return qw( core pbp bugs certrec ) }
41sub applies_to { return 'PPI::Statement::Include' }
42
43#-----------------------------------------------------------------------------
44
45sub violates {
46 my ($self, $elem, $doc) = @_;
47
48 return if $elem->type ne 'no';
49 return if $elem->module ne 'strict';
50
51 my $sib = $elem->snext_sibling;
52 my $nstatements = 0;
53 while ($nstatements++ <= $self->{_statements}) {
54 return if !$sib;
55 return if $sib->isa('PPI::Statement::Include') &&
56 $sib->type eq 'use' &&
57 $sib->module eq 'strict';
58 $sib = $sib->snext_sibling;
59 }
60
61 return $self->violation( $DESC, $EXPL, $elem );
62}
63
6413µs1;
65
66#-----------------------------------------------------------------------------
67
68__END__