Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/InputOutput/ProhibitBacktickOperators.pm |
Statements | Executed 20 statements in 505µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 26µs | 26µs | BEGIN@10 | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 12µs | 277µs | BEGIN@15 | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 12µs | 46µs | BEGIN@13 | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 12µs | 100µs | BEGIN@17 | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 11µs | 17µs | BEGIN@12 | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 11µs | 30µs | BEGIN@11 | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 8µs | 10µs | default_severity | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
1 | 1 | 1 | 5µs | 5µs | supported_parameters | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
0 | 0 | 0 | 0s | 0s | applies_to | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
0 | 0 | 0 | 0s | 0s | default_themes | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
0 | 0 | 0 | 0s | 0s | violates | Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::
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::InputOutput::ProhibitBacktickOperators; | ||||
9 | |||||
10 | 2 | 66µs | 1 | 26µs | # spent 26µs within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@10 which was called:
# once (26µs+0s) by Module::Pluggable::Object::_require at line 10 # spent 26µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@10 |
11 | 2 | 32µs | 2 | 50µs | # spent 30µs (11+19) within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@11 which was called:
# once (11µs+19µs) by Module::Pluggable::Object::_require at line 11 # spent 30µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@11
# spent 19µs making 1 call to strict::import |
12 | 2 | 30µs | 2 | 23µs | # spent 17µs (11+6) within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@12 which was called:
# once (11µs+6µs) by Module::Pluggable::Object::_require at line 12 # spent 17µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@12
# spent 6µs making 1 call to warnings::import |
13 | 2 | 44µs | 2 | 81µs | # spent 46µs (12+35) within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@13 which was called:
# once (12µs+35µs) by Module::Pluggable::Object::_require at line 13 # spent 46µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@13
# spent 35µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 40µs | 2 | 541µs | # spent 277µs (12+265) within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@15 which was called:
# once (12µs+265µs) by Module::Pluggable::Object::_require at line 15 # spent 277µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@15
# spent 265µs making 1 call to Exporter::import |
16 | |||||
17 | 2 | 269µs | 2 | 188µs | # spent 100µs (12+88) within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@17 which was called:
# once (12µs+88µs) by Module::Pluggable::Object::_require at line 17 # spent 100µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::BEGIN@17
# spent 88µs making 1 call to base::import |
18 | |||||
19 | 1 | 900ns | our $VERSION = '1.121'; | ||
20 | |||||
21 | #----------------------------------------------------------------------------- | ||||
22 | |||||
23 | 1 | 3µs | 1 | 47µs | Readonly::Scalar my $EXPL => q{Use IPC::Open3 instead}; # spent 47µs making 1 call to Readonly::Scalar |
24 | 1 | 2µs | 1 | 34µs | Readonly::Scalar my $DESC => q{Backtick operator used}; # spent 34µs making 1 call to Readonly::Scalar |
25 | |||||
26 | 1 | 2µs | 1 | 32µs | Readonly::Scalar my $VOID_EXPL => q{Assign result to a variable or use system() instead}; # spent 32µs making 1 call to Readonly::Scalar |
27 | 1 | 2µs | 1 | 32µs | Readonly::Scalar my $VOID_DESC => q{Backtick operator used in void context}; # spent 32µs making 1 call to Readonly::Scalar |
28 | |||||
29 | #----------------------------------------------------------------------------- | ||||
30 | |||||
31 | # spent 5µs within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::supported_parameters which was called:
# once (5µs+0s) by Perl::Critic::Policy::new at line 88 of Perl/Critic/Policy.pm | ||||
32 | return ( | ||||
33 | { | ||||
34 | 1 | 7µs | name => 'only_in_void_context', | ||
35 | description => 'Allow backticks everywhere except in void contexts.', | ||||
36 | behavior => 'boolean', | ||||
37 | }, | ||||
38 | ); | ||||
39 | } | ||||
40 | |||||
41 | 1 | 2µs | # spent 10µs (8+2) within Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators::default_severity which was called:
# once (8µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm | ||
42 | sub default_themes { return qw(core maintenance) } | ||||
43 | sub applies_to { return qw(PPI::Token::QuoteLike::Backtick | ||||
44 | PPI::Token::QuoteLike::Command ) } | ||||
45 | |||||
46 | #----------------------------------------------------------------------------- | ||||
47 | |||||
48 | sub violates { | ||||
49 | my ( $self, $elem, undef ) = @_; | ||||
50 | |||||
51 | if ( $self->{_only_in_void_context} ) { | ||||
52 | return if not is_in_void_context( $elem ); | ||||
53 | |||||
54 | return $self->violation( $VOID_DESC, $VOID_EXPL, $elem ); | ||||
55 | } | ||||
56 | |||||
57 | return $self->violation( $DESC, $EXPL, $elem ); | ||||
58 | } | ||||
59 | |||||
60 | 1 | 6µs | 1; | ||
61 | |||||
62 | __END__ |