blib/lib/Perl/Critic/PolicyParameter/Behavior.pm

filter: Statementstmt 89.4% 17 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 66.6% 2 / 3 totaltotal 86.2% 25 / 29 CC 1 SCAR 1.3
CC
1
Cov
89%
initialize_parameter
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Perl/Critic/Policy/ValuesAndExpressions/ProhibitEmptyQuotes.pm ↑ Summary blib/script/perlcritic »
1 package Perl::Critic::PolicyParameter::Behavior;
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 Perl::Critic::Utils qw{ :characters };
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 our $VERSION = '1.150';
10  
11 #-----------------------------------------------------------------------------
12  
13 sub new {
14 200 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
15  
16 200 return bless {}, $class;
17 }
18  
19 #-----------------------------------------------------------------------------
20  
21 sub initialize_parameter {
22 0 ▶ my ($self, $parameter, $specification) = @_;
Subroutine initialize_parameter: not called CC=1 SCAR=6.9
Pod documented
23  
24 0 return;
25 }
26  
27 #-----------------------------------------------------------------------------
28  
29 sub generate_parameter_description {
30 401 ▶ my ($self, $parameter) = @_;
Subroutine generate_parameter_description: called CC=1 SCAR=0.0
Pod documented
31  
32 401 return $parameter->_get_description_with_trailing_period();
33 }
34  
35 #-----------------------------------------------------------------------------
36  
37 40 1;
38  
39 __END__
40  
41 #-----------------------------------------------------------------------------
42  
43 =pod
44  
45 =for stopwords
46  
47 =head1 NAME
48  
49 Perl::Critic::PolicyParameter::Behavior - Default type-specific actions for a parameter.
50  
51  
52 =head1 DESCRIPTION
53  
54 Provides a standard set of functionality for a
55 L<Perl::Critic::PolicyParameter|Perl::Critic::PolicyParameter> so that
56 the developer of a policy does not have to provide it her/himself.
57 The developer can override most of the functionality in the
58 subclasses; these are just defaults.
59  
60 All subclasses have singleton instances held onto by
61 L<Perl::Critic::PolicyParameter|Perl::Critic::PolicyParameter>.
62  
63  
64 =head1 INTERFACE SUPPORT
65  
66 This is considered to be a non-public class. Its interface is subject
67 to change without notice.
68  
69  
70 =head1 METHODS
71  
72 =over
73  
74 =item C<initialize_parameter( $parameter, $specification )>
75  
76 Plug in the functionality this behavior provides into the parameter,
77 based upon the configuration provided by the specification. The
78 configuration items looked for depends upon the specific behavior
79 subclass.
80  
81 =item C<generate_parameter_description( $parameter )>
82  
83 Create a description of the parameter, based upon the description on
84 the parameter itself, but enhancing it with information from this
85 behavior.
86  
87 Note that this may return C<undef> if the parameter itself doesn't
88 have a description. Also, the returned value may include multiple
89 lines.
90  
91 =back
92  
93  
94 =head1 AUTHOR
95  
96 Elliot Shank <perl@galumph.com>
97  
98 =head1 COPYRIGHT
99  
100 Copyright (c) 2006-2011 Elliot Shank.
101  
102 This program is free software; you can redistribute it and/or modify
103 it under the same terms as Perl itself. The full text of this license
104 can be found in the LICENSE file included with this module.
105  
106 =cut
107  
108 # Local Variables:
109 # mode: cperl
110 # cperl-indent-level: 4
111 # fill-column: 78
112 # indent-tabs-mode: nil
113 # c-indentation-style: bsd
114 # End:
115 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :
« blib/lib/Perl/Critic/Policy/ValuesAndExpressions/ProhibitEmptyQuotes.pm ↑ Summary blib/script/perlcritic »