Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/BuiltinFunctions/RequireBlockGrep.pm |
Statements | Executed 18 statements in 301µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 19µs | 19µs | BEGIN@14 | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 8µs | 63µs | BEGIN@20 | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 7µs | 426µs | BEGIN@19 | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 7µs | 27µs | BEGIN@17 | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 7µs | 18µs | BEGIN@15 | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 7µs | 11µs | BEGIN@16 | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 6µs | 7µs | default_severity | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
1 | 1 | 1 | 3µs | 3µs | supported_parameters | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
0 | 0 | 0 | 0s | 0s | applies_to | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
0 | 0 | 0 | 0s | 0s | violates | Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::
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::BuiltinFunctions::RequireBlockGrep; | ||||
9 | |||||
10 | # DEVELOPER NOTE: this module is used as an example in DEVELOPER.pod. | ||||
11 | # If you make changes in here, please reflect those changes in the | ||||
12 | # examples. | ||||
13 | |||||
14 | 2 | 42µs | 1 | 19µs | # spent 19µs within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@14 which was called:
# once (19µs+0s) by Module::Pluggable::Object::_require at line 14 # spent 19µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@14 |
15 | 2 | 20µs | 2 | 29µs | # spent 18µs (7+11) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@15 which was called:
# once (7µs+11µs) by Module::Pluggable::Object::_require at line 15 # spent 18µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@15
# spent 11µs making 1 call to strict::import |
16 | 2 | 18µs | 2 | 16µs | # spent 11µs (7+4) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@16 which was called:
# once (7µs+4µs) by Module::Pluggable::Object::_require at line 16 # spent 11µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@16
# spent 4µs making 1 call to warnings::import |
17 | 2 | 26µs | 2 | 47µs | # spent 27µs (7+20) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@17 which was called:
# once (7µs+20µs) by Module::Pluggable::Object::_require at line 17 # spent 27µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@17
# spent 20µs making 1 call to Exporter::import |
18 | |||||
19 | 2 | 25µs | 2 | 845µs | # spent 426µs (7+419) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@19 which was called:
# once (7µs+419µs) by Module::Pluggable::Object::_require at line 19 # spent 426µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@19
# spent 419µs making 1 call to Exporter::import |
20 | 2 | 155µs | 2 | 119µs | # spent 63µs (8+56) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@20 which was called:
# once (8µs+56µs) by Module::Pluggable::Object::_require at line 20 # spent 63µs making 1 call to Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::BEGIN@20
# spent 56µs making 1 call to base::import |
21 | |||||
22 | 1 | 600ns | our $VERSION = '1.121'; | ||
23 | |||||
24 | #----------------------------------------------------------------------------- | ||||
25 | |||||
26 | 1 | 2µs | 1 | 28µs | Readonly::Scalar my $DESC => q{Expression form of "grep"}; # spent 28µs making 1 call to Readonly::Scalar |
27 | 1 | 2µs | 1 | 44µs | Readonly::Scalar my $EXPL => [ 169 ]; # spent 44µs making 1 call to Readonly::Scalar |
28 | |||||
29 | #----------------------------------------------------------------------------- | ||||
30 | |||||
31 | 1 | 6µs | # spent 3µs within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::supported_parameters which was called:
# once (3µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||
32 | 1 | 2µs | # spent 7µs (6+1) within Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep::default_severity which was called:
# once (6µs+1µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
33 | sub default_themes { return qw( core bugs pbp ) } | ||||
34 | sub applies_to { return 'PPI::Token::Word' } | ||||
35 | |||||
36 | #----------------------------------------------------------------------------- | ||||
37 | |||||
38 | sub violates { | ||||
39 | my ( $self, $elem, undef ) = @_; | ||||
40 | |||||
41 | return if $elem ne 'grep'; | ||||
42 | return if ! is_function_call($elem); | ||||
43 | |||||
44 | my $arg = first_arg($elem); | ||||
45 | return if !$arg; | ||||
46 | return if $arg->isa('PPI::Structure::Block'); | ||||
47 | |||||
48 | return $self->violation( $DESC, $EXPL, $elem ); | ||||
49 | } | ||||
50 | |||||
51 | 1 | 3µs | 1; | ||
52 | |||||
53 | __END__ |