FormHandler/Field/Display.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond 80.0% 4 / 5 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 92.3% 48 / 52 CC 4 SCAR 7.4
CC
4
Cov
97%
build_render_method
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« FormHandler/Widget/Field/ButtonTag.pm ↑ Summary FormHandler/Field/Email.pm »
1 package HTML::FormHandler::Field::Display;
2 # ABSTRACT: display only field
3 5 $HTML::FormHandler::Field::Display::VERSION = '0.410002';
4 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 extends 'HTML::FormHandler::Field::NoValue';
6 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 5 has 'html' => ( is => 'rw', isa => 'Str', builder => 'build_html', lazy => 1 );
10 3 ▶sub build_html {''}
Subroutine build_html: called CC=1 SCAR=0.0
Pod undocumented
11 5 has 'set_html' => ( isa => 'Str', is => 'ro');
12 5 has '+do_label' => ( default => 0 );
13  
14 5 has 'render_method' => (
15 traits => ['Code'],
16 is => 'ro',
17 isa => 'CodeRef',
18 lazy => 1,
19 predicate => 'does_render_method',
20 handles => { 'render' => 'execute_method' },
21 builder => 'build_render_method',
22 );
23  
24 6 ▶sub build_render_method {
Subroutine build_render_method: called CC=4 SCAR=13.9
Pod undocumented
25 6 my $self = shift;
26  
27 6 my $set_html = $self->set_html;
28 6 ▶ $set_html ||= "html_" . HTML::FormHandler::Field::convert_full_name($self->full_name);
Condition100%2/2
$set_html ||= 'html_' . HTML::FormHandler::Field::convert_full_name($self->full_name)
l!l
15
MC/DC100%1/1
$set_html ||= 'html_' . HTML::FormHandler::Field::convert_full_name($self->full_name)
$set_html
Truth table100%2/2
A
A= $set_html
Aresult
11
00
29 2 ▶ return sub { my $self = shift; $self->form->$set_html($self); }
Subroutine __ANON__: called CC=1 SCAR=0.0
30 6 ▶ if ( $self->form && $self->form->can($set_html) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->form and $self->form->can($set_html) 2 4 6
Condition66%2/3
$self->form and $self->form->can($set_html)
!ll&&!rl&&r
042
MC/DC50%1/2
$self->form and $self->form->can($set_html)
$self->form $self->form->can($set_html)
Truth table66%2/3
A and B
A= $self->formB= $self->form->can($set_html)
ABresult
0X0
100
111
31 4 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
32 4 my $self = shift;
33 4 return $self->html;
34 4 };
35 }
36  
37 1 ▶sub _result_from_object {
Subroutine _result_from_object: called CC=1 SCAR=0.0
38 1 my ( $self, $result, $value ) = @_;
39 1 $self->_set_result($result);
40 1 $self->value($value);
41 1 $result->_set_field_def($self);
42 1 return $result;
43 }
44  
45 5 __PACKAGE__->meta->make_immutable;
46 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 5 1;
48  
49 __END__
« FormHandler/Widget/Field/ButtonTag.pm ↑ Summary FormHandler/Field/Email.pm »