Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/TestingAndDebugging/ProhibitProlongedStrictureOverride.pm |
Statements | Executed 18 statements in 338µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 18µs | 18µs | BEGIN@10 | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 8µs | 29µs | BEGIN@13 | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 8µs | 20µs | BEGIN@11 | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 8µs | 11µs | BEGIN@12 | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 7µs | 150µs | BEGIN@15 | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 7µs | 59µs | BEGIN@16 | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 6µs | 7µs | default_severity | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
1 | 1 | 1 | 5µs | 5µs | supported_parameters | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
0 | 0 | 0 | 0s | 0s | applies_to | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
0 | 0 | 0 | 0s | 0s | violates | Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::
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::TestingAndDebugging::ProhibitProlongedStrictureOverride; | ||||
9 | |||||
10 | 2 | 42µs | 1 | 18µ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 # spent 18µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@10 |
11 | 2 | 21µs | 2 | 32µ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 # spent 20µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@11
# spent 12µs making 1 call to strict::import |
12 | 2 | 19µs | 2 | 15µ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 # spent 11µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | 2 | 22µs | 2 | 50µ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 # spent 29µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@13
# spent 21µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 27µs | 2 | 292µ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 # spent 150µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@15
# spent 142µs making 1 call to Exporter::import |
16 | 2 | 190µs | 2 | 110µ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 # spent 59µs making 1 call to Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride::BEGIN@16
# spent 52µ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{Don't turn off strict for large blocks of code}; # spent 28µs making 1 call to Readonly::Scalar |
23 | 1 | 2µs | 1 | 42µs | Readonly::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 | ||||
28 | return ( | ||||
29 | { | ||||
30 | 1 | 8µ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 | |||||
39 | 1 | 2µ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 | ||
40 | sub default_themes { return qw( core pbp bugs certrec ) } | ||||
41 | sub applies_to { return 'PPI::Statement::Include' } | ||||
42 | |||||
43 | #----------------------------------------------------------------------------- | ||||
44 | |||||
45 | sub 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 | |||||
64 | 1 | 3µs | 1; | ||
65 | |||||
66 | #----------------------------------------------------------------------------- | ||||
67 | |||||
68 | __END__ |