Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/StringList.pm |
Statements | Executed 460 statements in 994µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
32 | 1 | 1 | 588µs | 1.08ms | __ANON__[:60] | Perl::Critic::PolicyParameter::Behavior::StringList::
32 | 1 | 1 | 292µs | 383µs | initialize_parameter | Perl::Critic::PolicyParameter::Behavior::StringList::
1 | 1 | 1 | 15µs | 15µs | BEGIN@10 | Perl::Critic::PolicyParameter::Behavior::StringList::
1 | 1 | 1 | 8µs | 61µs | BEGIN@16 | Perl::Critic::PolicyParameter::Behavior::StringList::
1 | 1 | 1 | 7µs | 11µs | BEGIN@12 | Perl::Critic::PolicyParameter::Behavior::StringList::
1 | 1 | 1 | 7µs | 286µs | BEGIN@14 | Perl::Critic::PolicyParameter::Behavior::StringList::
1 | 1 | 1 | 6µs | 18µs | BEGIN@11 | Perl::Critic::PolicyParameter::Behavior::StringList::
0 | 0 | 0 | 0s | 0s | generate_parameter_description | Perl::Critic::PolicyParameter::Behavior::StringList::
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::PolicyParameter::Behavior::StringList; | ||||
9 | |||||
10 | 2 | 40µs | 1 | 15µs | # spent 15µs within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@10 which was called:
# once (15µs+0s) by Perl::Critic::PolicyParameter::BEGIN@28 at line 10 # spent 15µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@10 |
11 | 2 | 19µs | 2 | 29µs | # spent 18µs (6+11) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@11 which was called:
# once (6µs+11µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 11 # spent 18µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@11
# spent 11µs making 1 call to strict::import |
12 | 2 | 20µs | 2 | 14µs | # spent 11µs (7+4) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@12 which was called:
# once (7µs+4µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 12 # spent 11µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 24µs | 2 | 565µs | # spent 286µs (7+279) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@14 which was called:
# once (7µs+279µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 14 # spent 286µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@14
# spent 279µs making 1 call to Exporter::import |
15 | |||||
16 | 2 | 226µs | 2 | 61µs | # spent 61µs (8+53) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@16 which was called:
# once (8µs+53µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 16 # spent 61µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@16
# spent 53µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 53µs |
17 | |||||
18 | 1 | 600ns | our $VERSION = '1.121'; | ||
19 | |||||
20 | #----------------------------------------------------------------------------- | ||||
21 | |||||
22 | # spent 383µs (292+90) within Perl::Critic::PolicyParameter::Behavior::StringList::initialize_parameter which was called 32 times, avg 12µs/call:
# 32 times (292µs+90µs) by Perl::Critic::PolicyParameter::_initialize_from_behavior at line 115 of Perl/Critic/PolicyParameter.pm, avg 12µs/call | ||||
23 | 32 | 7µs | my ($self, $parameter, $specification) = @_; | ||
24 | |||||
25 | # Unfortunately, this has to be kept as a reference, rather than a regular | ||||
26 | # array, due to a problem in Devel::Cycle | ||||
27 | # (http://rt.cpan.org/Ticket/Display.html?id=25360) which causes | ||||
28 | # t/92_memory_leaks.t to fall over. | ||||
29 | 32 | 8µs | my $always_present_values = $specification->{list_always_present_values}; | ||
30 | 32 | 41µs | 32 | 36µs | $parameter->_get_behavior_values()->{always_present_values} = # spent 36µs making 32 calls to Perl::Critic::PolicyParameter::_get_behavior_values, avg 1µs/call |
31 | $always_present_values; | ||||
32 | |||||
33 | 32 | 10µs | if ( not $always_present_values ) { | ||
34 | $always_present_values = []; | ||||
35 | } | ||||
36 | |||||
37 | $parameter->_set_parser( | ||||
38 | # spent 1.08ms (588µs+491µs) within Perl::Critic::PolicyParameter::Behavior::StringList::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/StringList.pm:60] which was called 32 times, avg 34µs/call:
# 32 times (588µs+491µs) by Perl::Critic::PolicyParameter::parse_and_validate_config_value at line 231 of Perl/Critic/PolicyParameter.pm, avg 34µs/call | ||||
39 | # Normally bad thing, obscuring a variable in a outer scope | ||||
40 | # with a variable with the same name is being done here in | ||||
41 | # order to remain consistent with the parser function interface. | ||||
42 | 32 | 9µs | my ($policy, $parameter, $config_string) = @_; ## no critic(Variables::ProhibitReusedNames) | ||
43 | |||||
44 | 32 | 27µs | my @values = @{$always_present_values}; | ||
45 | 32 | 39µs | 32 | 43µs | my $value_string = $parameter->get_default_string(); # spent 43µs making 32 calls to Perl::Critic::PolicyParameter::get_default_string, avg 1µs/call |
46 | |||||
47 | 32 | 5µs | if (defined $config_string) { | ||
48 | $value_string = $config_string; | ||||
49 | } | ||||
50 | |||||
51 | 32 | 46µs | 27 | 62µs | if ( defined $value_string ) { # spent 62µs making 27 calls to Perl::Critic::Utils::words_from_string, avg 2µs/call |
52 | push @values, words_from_string($value_string); | ||||
53 | } | ||||
54 | |||||
55 | 32 | 139µs | 32 | 87µs | my %values = hashify(@values); # spent 87µs making 32 calls to Perl::Critic::Utils::hashify, avg 3µs/call |
56 | |||||
57 | 32 | 73µs | 32 | 299µs | $policy->__set_parameter_value($parameter, \%values); # spent 299µs making 32 calls to Perl::Critic::Policy::__set_parameter_value, avg 9µs/call |
58 | |||||
59 | 32 | 98µs | return; | ||
60 | } | ||||
61 | 32 | 94µs | 32 | 54µs | ); # spent 54µs making 32 calls to Perl::Critic::PolicyParameter::_set_parser, avg 2µs/call |
62 | |||||
63 | 32 | 65µs | return; | ||
64 | } | ||||
65 | |||||
66 | #----------------------------------------------------------------------------- | ||||
67 | |||||
68 | sub generate_parameter_description { | ||||
69 | my ($self, $parameter) = @_; | ||||
70 | |||||
71 | my $always_present_values = | ||||
72 | $parameter->_get_behavior_values()->{always_present_values}; | ||||
73 | |||||
74 | my $description = $parameter->_get_description_with_trailing_period(); | ||||
75 | if ( $description and $always_present_values ) { | ||||
76 | $description .= qq{\n}; | ||||
77 | } | ||||
78 | |||||
79 | if ( $always_present_values ) { | ||||
80 | $description .= 'Values that are always included: '; | ||||
81 | $description .= join ', ', sort @{ $always_present_values }; | ||||
82 | $description .= $PERIOD; | ||||
83 | } | ||||
84 | |||||
85 | return $description; | ||||
86 | } | ||||
87 | |||||
88 | 1 | 2µs | 1; | ||
89 | |||||
90 | __END__ |