blib/lib/Perl/Critic/Exception/Configuration/Option/Global/ExtraParameter.pm

filter: Statementstmt 95.8% 23 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 93.9% 31 / 33 CC 2 SCAR 2.6
CC
2
Cov
92%
full_message
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Perl/Critic/Policy/ControlStructures/ProhibitCStyleForLoops.pm ↑ Summary blib/lib/Perl/Critic/Exception/Configuration/Option/Policy/ExtraParameter.pm »
1 package Perl::Critic::Exception::Configuration::Option::Global::ExtraParameter;
2  
3 40 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 40 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 our $VERSION = '1.150';
10  
11 #-----------------------------------------------------------------------------
12  
13 use Exception::Class (
14 40 'Perl::Critic::Exception::Configuration::Option::Global::ExtraParameter' => {
15 isa => 'Perl::Critic::Exception::Configuration::Option::Global',
16 description => 'The configuration referred to a non-existent global option.',
17 alias => 'throw_extra_global',
18 },
19 40 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 #-----------------------------------------------------------------------------
22  
23 40 Readonly::Array our @EXPORT_OK => qw< throw_extra_global >;
24  
25 #-----------------------------------------------------------------------------
26  
27 sub full_message {
28 4 ▶ my ( $self ) = @_;
Subroutine full_message: called CC=2 SCAR=7.1
Pod documented
29  
30 4 my $source = $self->source();
31 4 ▶ if ($source) {
Branch: 1 branch
BranchTrueFalseTotal
if ($source) { } 0 4 4
32 0 $source = qq{ (found in "$source")};
33 }
34 else {
35 4 $source = q{};
36 }
37  
38 4 my $option_name = $self->option_name();
39  
40 4 return qq{"$option_name" is not a supported option$source.};
41 }
42  
43  
44 40 1;
45  
46 __END__
47  
48 #-----------------------------------------------------------------------------
49  
50 =pod
51  
52 =for stopwords
53  
54 =head1 NAME
55  
56 Perl::Critic::Exception::Configuration::Option::Global::ExtraParameter - The configuration referred to a non-existent global option.
57  
58 =head1 DESCRIPTION
59  
60 A representation of the configuration attempting to specify a value
61 for an option that L<Perl::Critic|Perl::Critic> doesn't have, whether
62 from a F<.perlcriticrc>, another profile file, or command line.
63  
64  
65 =head1 INTERFACE SUPPORT
66  
67 This is considered to be a public class. Any changes to its interface
68 will go through a deprecation cycle.
69  
70  
71 =head1 CLASS METHODS
72  
73 =over
74  
75 =item C<< throw( option_name => $option_name, source => $source ) >>
76  
77 See L<Exception::Class/"throw">.
78  
79  
80 =item C<< new( option_name => $option_name, source => $source ) >>
81  
82 See L<Exception::Class/"new">.
83  
84  
85 =back
86  
87  
88 =head1 METHODS
89  
90 =over
91  
92 =item C<full_message()>
93  
94 Provide a standard message for values for non-existent parameters for
95 policies. See L<Exception::Class/"full_message">.
96  
97  
98 =back
99  
100  
101 =head1 AUTHOR
102  
103 Elliot Shank <perl@galumph.com>
104  
105 =head1 COPYRIGHT
106  
107 Copyright (c) 2007-2011 Elliot Shank.
108  
109 This program is free software; you can redistribute it and/or modify
110 it under the same terms as Perl itself. The full text of this license
111 can be found in the LICENSE file included with this module.
112  
113 =cut
114  
115 # Local Variables:
116 # mode: cperl
117 # cperl-indent-level: 4
118 # fill-column: 78
119 # indent-tabs-mode: nil
120 # c-indentation-style: bsd
121 # End:
122 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :
« blib/lib/Perl/Critic/Policy/ControlStructures/ProhibitCStyleForLoops.pm ↑ Summary blib/lib/Perl/Critic/Exception/Configuration/Option/Policy/ExtraParameter.pm »