Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Exception/AggregateConfiguration.pm |
Statements | Executed 3044 statements in 4.30ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
424 | 4 | 3 | 2.19ms | 258ms | new | Perl::Critic::Exception::AggregateConfiguration::
425 | 5 | 3 | 1.51ms | 2.01ms | has_exceptions | Perl::Critic::Exception::AggregateConfiguration::
238 | 2 | 2 | 305µs | 305µs | add_exception_or_rethrow | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 18µs | 18µs | BEGIN@10 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 11µs | 29µs | BEGIN@16 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 10µs | 14µs | BEGIN@12 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 10µs | 20µs | BEGIN@11 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 9µs | 211µs | BEGIN@24 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 8µs | 254µs | BEGIN@18 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 7µs | 28µs | BEGIN@14 | Perl::Critic::Exception::AggregateConfiguration::
1 | 1 | 1 | 6µs | 365µs | BEGIN@15 | Perl::Critic::Exception::AggregateConfiguration::
0 | 0 | 0 | 0s | 0s | add_exception | Perl::Critic::Exception::AggregateConfiguration::
0 | 0 | 0 | 0s | 0s | add_exceptions_from | Perl::Critic::Exception::AggregateConfiguration::
0 | 0 | 0 | 0s | 0s | full_message | Perl::Critic::Exception::AggregateConfiguration::
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::Exception::AggregateConfiguration; | ||||
9 | |||||
10 | 2 | 39µs | 1 | 18µ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 # spent 18µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@10 |
11 | 2 | 20µs | 2 | 31µ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 # spent 20µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@11
# spent 10µs making 1 call to strict::import |
12 | 2 | 19µs | 2 | 17µ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 # spent 14µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 20µs | 2 | 49µ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 # spent 28µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@14
# spent 21µs making 1 call to Exporter::import |
15 | 2 | 21µs | 2 | 723µ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 # spent 365µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@15
# spent 358µs making 1 call to English::import |
16 | 2 | 21µs | 2 | 47µ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 # spent 29µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@16
# spent 18µs making 1 call to Exporter::import |
17 | |||||
18 | 2 | 44µs | 2 | 500µ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 # spent 254µs making 1 call to Perl::Critic::Exception::AggregateConfiguration::BEGIN@18
# spent 246µs making 1 call to Exporter::import |
19 | |||||
20 | 1 | 300ns | our $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 | ||||
25 | 1 | 300ns | '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 | }, | ||||
31 | 1 | 280µs | 2 | 413µ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 | |||||
35 | 1 | 2µs | 1 | 26µs | Readonly::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 | ||||
40 | 424 | 177µs | my ($class, %options) = @_; | ||
41 | |||||
42 | 424 | 106µs | my $exceptions = $options{exceptions}; | ||
43 | 424 | 240µs | if (not $exceptions) { | ||
44 | $options{exceptions} = []; | ||||
45 | } | ||||
46 | |||||
47 | 424 | 1.59ms | 424 | 255ms | return $class->SUPER::new(%options); # spent 255ms making 424 calls to Exception::Class::Base::new, avg 602µs/call |
48 | } | ||||
49 | |||||
50 | #----------------------------------------------------------------------------- | ||||
51 | |||||
52 | sub add_exception { | ||||
53 | my ( $self, $exception ) = @_; | ||||
54 | |||||
55 | push @{ $self->exceptions() }, $exception; | ||||
56 | |||||
57 | return; | ||||
58 | } | ||||
59 | |||||
60 | #----------------------------------------------------------------------------- | ||||
61 | |||||
62 | sub 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 | ||||
73 | 238 | 53µs | my ( $self, $eval_error ) = @_; | ||
74 | |||||
75 | 238 | 453µ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 | ||||
96 | 425 | 77µs | my ( $self ) = @_; | ||
97 | |||||
98 | 425 | 1.12ms | 425 | 493µ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 | |||||
103 | 1 | 1µs | 1 | 34µs | Readonly::Scalar my $MESSAGE_PREFIX => $EMPTY; # spent 34µs making 1 call to Readonly::Scalar |
104 | 1 | 900ns | 1 | 20µs | Readonly::Scalar my $MESSAGE_SUFFIX => "\n"; # spent 20µs making 1 call to Readonly::Scalar |
105 | 1 | 4µs | 3 | 23µs | Readonly::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 | |||||
107 | sub 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 | |||||
117 | 1 | 4µs | 1; | ||
118 | |||||
119 | #----------------------------------------------------------------------------- | ||||
120 | |||||
121 | __END__ |