← 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/Exception/AggregateConfiguration.pm
StatementsExecuted 3044 statements in 4.30ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
424432.19ms258msPerl::Critic::Exception::AggregateConfiguration::::newPerl::Critic::Exception::AggregateConfiguration::new
425531.51ms2.01msPerl::Critic::Exception::AggregateConfiguration::::has_exceptionsPerl::Critic::Exception::AggregateConfiguration::has_exceptions
23822305µs305µsPerl::Critic::Exception::AggregateConfiguration::::add_exception_or_rethrowPerl::Critic::Exception::AggregateConfiguration::add_exception_or_rethrow
11118µs18µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@10Perl::Critic::Exception::AggregateConfiguration::BEGIN@10
11111µs29µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@16Perl::Critic::Exception::AggregateConfiguration::BEGIN@16
11110µs14µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@12Perl::Critic::Exception::AggregateConfiguration::BEGIN@12
11110µs20µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@11Perl::Critic::Exception::AggregateConfiguration::BEGIN@11
1119µs211µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@24Perl::Critic::Exception::AggregateConfiguration::BEGIN@24
1118µs254µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@18Perl::Critic::Exception::AggregateConfiguration::BEGIN@18
1117µs28µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@14Perl::Critic::Exception::AggregateConfiguration::BEGIN@14
1116µs365µsPerl::Critic::Exception::AggregateConfiguration::::BEGIN@15Perl::Critic::Exception::AggregateConfiguration::BEGIN@15
0000s0sPerl::Critic::Exception::AggregateConfiguration::::add_exceptionPerl::Critic::Exception::AggregateConfiguration::add_exception
0000s0sPerl::Critic::Exception::AggregateConfiguration::::add_exceptions_fromPerl::Critic::Exception::AggregateConfiguration::add_exceptions_from
0000s0sPerl::Critic::Exception::AggregateConfiguration::::full_messagePerl::Critic::Exception::AggregateConfiguration::full_message
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::Exception::AggregateConfiguration;
9
10239µs118µs
# spent 18µs within Perl::Critic::Exception::AggregateConfiguration::BEGIN@10 which was called: # once (18µs+0s) by Perl::Critic::Config::BEGIN@20 at line 10
use 5.006001;
11220µs231µs
# spent 20µs (10+10) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@11 which was called: # once (10µs+10µs) by Perl::Critic::Config::BEGIN@20 at line 11
use strict;
# spent 20µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@11 # spent 10µs making 1 call to strict::import
12219µs217µs
# spent 14µs (10+4) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@12 which was called: # once (10µs+4µs) by Perl::Critic::Config::BEGIN@20 at line 12
use warnings;
# spent 14µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@12 # spent 4µs making 1 call to warnings::import
13
14220µs249µs
# spent 28µs (7+21) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@14 which was called: # once (7µs+21µs) by Perl::Critic::Config::BEGIN@20 at line 14
use Carp qw{ confess };
# spent 28µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@14 # spent 21µs making 1 call to Exporter::import
15221µs2723µs
# spent 365µs (6+358) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@15 which was called: # once (6µs+358µs) by Perl::Critic::Config::BEGIN@20 at line 15
use English qw(-no_match_vars);
# spent 365µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@15 # spent 358µs making 1 call to English::import
16221µs247µs
# spent 29µs (11+18) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@16 which was called: # once (11µs+18µs) by Perl::Critic::Config::BEGIN@20 at line 16
use Readonly;
# spent 29µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@16 # spent 18µs making 1 call to Exporter::import
17
18244µs2500µs
# spent 254µs (8+246) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@18 which was called: # once (8µs+246µs) by Perl::Critic::Config::BEGIN@20 at line 18
use Perl::Critic::Utils qw{ :characters };
# spent 254µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@18 # spent 246µs making 1 call to Exporter::import
19
201300nsour $VERSION = '1.121';
21
22#-----------------------------------------------------------------------------
23
24
# spent 211µs (9+202) within Perl::Critic::Exception::AggregateConfiguration::BEGIN@24 which was called: # once (9µs+202µs) by Perl::Critic::Config::BEGIN@20 at line 31
use Exception::Class (
251300ns 'Perl::Critic::Exception::AggregateConfiguration' => {
26 isa => 'Perl::Critic::Exception',
27 description => 'A collected set of configuration exceptions.',
28 fields => [ qw{ exceptions } ],
29 alias => 'throw_aggregate',
30 },
311280µs2413µs);
# spent 211µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@24 # spent 202µs making 1 call to Exception::Class::import
32
33#-----------------------------------------------------------------------------
34
3512µs126µsReadonly::Array our @EXPORT_OK => qw< throw_aggregate >;
# spent 26µs making 1 call to Readonly::Array
36
37#-----------------------------------------------------------------------------
38
39
# spent 258ms (2.19+255) within Perl::Critic::Exception::AggregateConfiguration::new which was called 424 times, avg 608µs/call: # 141 times (700µs+89.8ms) by Perl::Critic::PolicyConfig::handle_extra_parameters at line 170 of Perl/Critic/PolicyConfig.pm, avg 642µs/call # 141 times (738µs+86.2ms) by Perl::Critic::Policy::new at line 94 of Perl/Critic/Policy.pm, avg 617µs/call # 141 times (739µs+78.9ms) by Perl::Critic::Policy::__set_base_parameters at line 159 of Perl/Critic/Policy.pm, avg 565µs/call # once (15µs+586µs) by Perl::Critic::Config::_init at line 66 of Perl/Critic/Config.pm
sub new {
40424177µs my ($class, %options) = @_;
41
42424106µs my $exceptions = $options{exceptions};
43424240µs if (not $exceptions) {
44 $options{exceptions} = [];
45 }
46
474241.59ms424255ms return $class->SUPER::new(%options);
# spent 255ms making 424 calls to Exception::Class::Base::new, avg 602µs/call
48}
49
50#-----------------------------------------------------------------------------
51
52sub add_exception {
53 my ( $self, $exception ) = @_;
54
55 push @{ $self->exceptions() }, $exception;
56
57 return;
58}
59
60#-----------------------------------------------------------------------------
61
62sub add_exceptions_from {
63 my ( $self, $aggregate ) = @_;
64
65 push @{ $self->exceptions() }, @{ $aggregate->exceptions() };
66
67 return;
68}
69
70#-----------------------------------------------------------------------------
71
72
# spent 305µs within Perl::Critic::Exception::AggregateConfiguration::add_exception_or_rethrow which was called 238 times, avg 1µs/call: # 141 times (186µs+0s) by Perl::Critic::PolicyFactory::create_all_policies at line 222 of Perl/Critic/PolicyFactory.pm, avg 1µs/call # 97 times (119µs+0s) by Perl::Critic::Policy::new at line 100 of Perl/Critic/Policy.pm, avg 1µs/call
sub add_exception_or_rethrow {
7323853µs my ( $self, $eval_error ) = @_;
74
75238453µs return if not $eval_error;
76 confess $eval_error if not ref $eval_error;
77
78 if ( $eval_error->isa('Perl::Critic::Exception::Configuration') ) {
79 $self->add_exception($eval_error);
80 }
81 elsif (
82 $eval_error->isa('Perl::Critic::Exception::AggregateConfiguration')
83 ) {
84 $self->add_exceptions_from($eval_error);
85 }
86 else {
87 die $eval_error; ## no critic (RequireCarping)
88 }
89
90 return;
91}
92
93#-----------------------------------------------------------------------------
94
95
# spent 2.01ms (1.51+493µs) within Perl::Critic::Exception::AggregateConfiguration::has_exceptions which was called 425 times, avg 5µs/call: # 141 times (528µs+152µs) by Perl::Critic::Policy::new at line 110 of Perl/Critic/Policy.pm, avg 5µs/call # 141 times (499µs+174µs) by Perl::Critic::PolicyConfig::handle_extra_parameters at line 183 of Perl/Critic/PolicyConfig.pm, avg 5µs/call # 141 times (476µs+164µs) by Perl::Critic::Policy::__set_base_parameters at line 181 of Perl/Critic/Policy.pm, avg 5µs/call # once (5µs+2µs) by Perl::Critic::Config::_init at line 155 of Perl/Critic/Config.pm # once (4µs+1µs) by Perl::Critic::Config::_load_policies at line 221 of Perl/Critic/Config.pm
sub has_exceptions {
9642577µs my ( $self ) = @_;
97
984251.12ms425493µs return @{ $self->exceptions() } ? 1 : 0;
# spent 493µs making 425 calls to Perl::Critic::Exception::AggregateConfiguration::exceptions, avg 1µs/call
99}
100
101#-----------------------------------------------------------------------------
102
10311µs134µsReadonly::Scalar my $MESSAGE_PREFIX => $EMPTY;
# spent 34µs making 1 call to Readonly::Scalar
1041900ns120µsReadonly::Scalar my $MESSAGE_SUFFIX => "\n";
# spent 20µs making 1 call to Readonly::Scalar
10514µs323µsReadonly::Scalar my $MESSAGE_SEPARATOR => $MESSAGE_SUFFIX . $MESSAGE_PREFIX;
# spent 21µs making 1 call to Readonly::Scalar # spent 2µs making 2 calls to Readonly::Scalar::FETCH, avg 1µs/call
106
107sub full_message {
108 my ( $self ) = @_;
109
110 my $message = $MESSAGE_PREFIX;
111 $message .= join $MESSAGE_SEPARATOR, @{ $self->exceptions() };
112 $message .= $MESSAGE_SUFFIX;
113
114 return $message;
115}
116
11714µs1;
118
119#-----------------------------------------------------------------------------
120
121__END__