line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue; |
2
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
889
|
use 5.010001; |
|
40
|
|
|
|
|
157
|
|
4
|
40
|
|
|
40
|
|
253
|
use strict; |
|
40
|
|
|
|
|
107
|
|
|
40
|
|
|
|
|
858
|
|
5
|
40
|
|
|
40
|
|
227
|
use warnings; |
|
40
|
|
|
|
|
92
|
|
|
40
|
|
|
|
|
1027
|
|
6
|
|
|
|
|
|
|
|
7
|
40
|
|
|
40
|
|
209
|
use Readonly; |
|
40
|
|
|
|
|
88
|
|
|
40
|
|
|
|
|
2136
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
344
|
use Perl::Critic::Utils qw{ :characters }; |
|
40
|
|
|
|
|
119
|
|
|
40
|
|
|
|
|
2097
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.146'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Exception::Class ( |
16
|
40
|
|
|
|
|
371
|
'Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue' => { |
17
|
|
|
|
|
|
|
isa => 'Perl::Critic::Exception::Configuration::Option::Policy', |
18
|
|
|
|
|
|
|
description => 'A problem with the value of a parameter for a policy.', |
19
|
|
|
|
|
|
|
alias => 'throw_policy_value', |
20
|
|
|
|
|
|
|
}, |
21
|
40
|
|
|
40
|
|
10309
|
); |
|
40
|
|
|
|
|
130
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw< throw_policy_value >; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub full_message { |
30
|
17
|
|
|
17
|
1
|
9846
|
my ( $self ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
17
|
|
|
|
|
372
|
my $source = $self->source(); |
33
|
17
|
50
|
|
|
|
124
|
if ($source) { |
34
|
0
|
|
|
|
|
0
|
$source = qq{ found in "$source"}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
else { |
37
|
17
|
|
|
|
|
50
|
$source = $EMPTY; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
17
|
|
|
|
|
360
|
my $policy = $self->policy(); |
41
|
17
|
|
|
|
|
359
|
my $option_name = $self->option_name(); |
42
|
17
|
50
|
|
|
|
343
|
my $option_value = |
43
|
|
|
|
|
|
|
defined $self->option_value() |
44
|
|
|
|
|
|
|
? $DQUOTE . $self->option_value() . $DQUOTE |
45
|
|
|
|
|
|
|
: '<undef>'; |
46
|
17
|
|
33
|
|
|
1012
|
my $message_suffix = $self->message_suffix() || $EMPTY; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return |
49
|
17
|
|
|
|
|
175
|
qq{The value for the $policy "$option_name" option } |
50
|
|
|
|
|
|
|
. qq{($option_value)$source $message_suffix}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=for stopwords |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 NAME |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue - A problem with the value of a parameter for a policy. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 DESCRIPTION |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
A representation of a problem found with the value of a parameter for |
71
|
|
|
|
|
|
|
a L<Perl::Critic::Policy|Perl::Critic::Policy>, whether from a |
72
|
|
|
|
|
|
|
F<.perlcriticrc>, another profile file, or command line. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is considered to be a public class. Any changes to its interface |
78
|
|
|
|
|
|
|
will go through a deprecation cycle. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 CLASS METHODS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=over |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item C<< throw( policy => $policy, option_name => $option_name, option_value => $option_value, source => $source, message_suffix => $message_suffix ) >> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
See L<Exception::Class/"throw">. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item C<< new( policy => $policy, option_name => $option_name, option_value => $option_value, source => $source, message_suffix => $message_suffix ) >> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
See L<Exception::Class/"new">. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=back |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 METHODS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=over |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item C<full_message()> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Provide a standard message for policy parameter value problems. See |
105
|
|
|
|
|
|
|
L<Exception::Class/"full_message">. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=back |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 AUTHOR |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 COPYRIGHT |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Copyright (c) 2007-2011 Elliot Shank. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
120
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
121
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
# Local Variables: |
126
|
|
|
|
|
|
|
# mode: cperl |
127
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
128
|
|
|
|
|
|
|
# fill-column: 78 |
129
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
130
|
|
|
|
|
|
|
# c-indentation-style: bsd |
131
|
|
|
|
|
|
|
# End: |
132
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |