← 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/InputOutput/ProhibitTwoArgOpen.pm
StatementsExecuted 27160 statements in 53.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
134811145.7ms413msPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::violatesPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::violates
14411258µs258µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::applies_toPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::applies_to
11118µs18µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@10Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@10
11112µs25µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@11Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@11
11110µs28µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@16Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@16
1119µs38µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@14Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@14
1118µs13µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@12Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@12
1118µs487µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@18Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@18
1118µs66µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::BEGIN@19Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@19
1118µs9µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::default_severityPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::default_severity
2213µs3µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::CORE:qrPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::CORE:qr (opcode)
1112µs2µsPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::supported_parametersPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::supported_parameters
0000s0sPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::::default_themesPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::default_themes
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::InputOutput::ProhibitTwoArgOpen;
9
10244µs118µs
# spent 18µs within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@10 which was called: # once (18µs+0s) by Module::Pluggable::Object::_require at line 10
use 5.006001;
11224µs238µs
# spent 25µs (12+13) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@11 which was called: # once (12µs+13µs) by Module::Pluggable::Object::_require at line 11
use strict;
# spent 25µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@11 # spent 13µs making 1 call to strict::import
12221µs217µs
# spent 13µs (8+4) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@12 which was called: # once (8µs+4µs) by Module::Pluggable::Object::_require at line 12
use warnings;
# spent 13µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@12 # spent 4µs making 1 call to warnings::import
13
14223µs268µs
# spent 38µs (9+30) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@14 which was called: # once (9µs+30µs) by Module::Pluggable::Object::_require at line 14
use Readonly;
# spent 38µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@14 # spent 30µs making 1 call to Exporter::import
15
16231µs247µs
# spent 28µs (10+19) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@16 which was called: # once (10µs+19µs) by Module::Pluggable::Object::_require at line 16
use version;
# spent 28µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@16 # spent 18µs making 1 call to version::import
17
18227µs2966µs
# spent 487µs (8+479) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@18 which was called: # once (8µs+479µs) by Module::Pluggable::Object::_require at line 18
use Perl::Critic::Utils qw{ :severities :classification :ppi };
# spent 487µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@18 # spent 479µs making 1 call to Exporter::import
192305µs2123µs
# spent 66µs (8+57) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@19 which was called: # once (8µs+57µs) by Module::Pluggable::Object::_require at line 19
use base 'Perl::Critic::Policy';
# spent 66µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::BEGIN@19 # spent 57µs making 1 call to base::import
20
211700nsour $VERSION = '1.121';
22
23#-----------------------------------------------------------------------------
24
25111µs234µsReadonly::Scalar my $STDIO_HANDLES_RX => qr/\b STD (?: IN | OUT | ERR \b)/xms;
# spent 32µs making 1 call to Readonly::Scalar # spent 2µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::CORE:qr
2615µs225µsReadonly::Scalar my $FORK_HANDLES_RX => qr/\A (?: -[|] | [|]- ) \z/xms;
# spent 24µs making 1 call to Readonly::Scalar # spent 1µs making 1 call to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::CORE:qr
2711µs123µsReadonly::Scalar my $DESC => q{Two-argument "open" used};
# spent 23µs making 1 call to Readonly::Scalar
2812µs148µsReadonly::Scalar my $EXPL => [ 207 ];
# spent 48µs making 1 call to Readonly::Scalar
29
30111µs230µsReadonly::Scalar my $MINIMUM_VERSION => version->new(5.006);
# spent 24µs making 1 call to Readonly::Scalar # spent 6µs making 1 call to version::new
31
32#-----------------------------------------------------------------------------
33
3416µs
# spent 2µs within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::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 () }
3512µs
# spent 9µs (8+2) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::default_severity which was called: # once (8µs+2µs) by Perl::Critic::Policy::get_severity at line 331 of Perl/Critic/Policy.pm
sub default_severity { return $SEVERITY_HIGHEST }
36sub default_themes { return qw(core pbp bugs security certrule) }
37144370µs
# spent 258µs within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::applies_to which was called 144 times, avg 2µs/call: # 144 times (258µs+0s) by Perl::Critic::_critique at line 165 of Perl/Critic.pm, avg 2µs/call
sub applies_to { return 'PPI::Token::Word' }
38
39#-----------------------------------------------------------------------------
40
41
# spent 413ms (45.7+368) within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::violates which was called 13481 times, avg 31µs/call: # 13481 times (45.7ms+368ms) by Perl::Critic::_critique at line 183 of Perl/Critic.pm, avg 31µs/call
sub violates {
42134813.09ms my ($self, $elem, $document) = @_;
43
441348149.1ms13481289ms return if $elem ne 'open';
# spent 289ms making 13481 calls to PPI::Element::__ne, avg 21µs/call
45612µs61.98ms return if ! is_function_call($elem);
# spent 1.98ms making 6 calls to Perl::Critic::Utils::is_function_call, avg 330µs/call
46
47519µs574.5ms my $version = $document->highest_explicit_perl_version();
# spent 74.5ms making 5 calls to Perl::Critic::Document::highest_explicit_perl_version, avg 14.9ms/call
48583µs2576µs return if $version and $version < $MINIMUM_VERSION;
# spent 46µs making 5 calls to version::(<=>, avg 9µs/call # spent 18µs making 15 calls to Readonly::Scalar::FETCH, avg 1µs/call # spent 13µs making 5 calls to version::(bool, avg 3µs/call
49
50511µs52.31ms my @args = parse_arg_list($elem);
# spent 2.31ms making 5 calls to Perl::Critic::Utils::parse_arg_list, avg 461µs/call
51
5252µs if ( scalar @args == 2 ) {
53 # When opening STDIN, STDOUT, or STDERR, the
54 # two-arg form is the only option you have.
55 return if $args[1]->[0] =~ $STDIO_HANDLES_RX;
56 return if $args[1]->[0]->isa( 'PPI::Token::Quote' )
57 && $args[1]->[0]->string() =~ $FORK_HANDLES_RX;
58 return $self->violation( $DESC, $EXPL, $elem );
59 }
60
61514µs return; # ok!
62}
63
6415µs1;
65
66__END__
 
# spent 3µs within Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::CORE:qr which was called 2 times, avg 2µs/call: # once (2µs+0s) by Module::Pluggable::Object::_require at line 25 # once (1µs+0s) by Module::Pluggable::Object::_require at line 26
sub Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::CORE:qr; # opcode