SyForm/View.pm

filter: Statementstmt 82.7% 24 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 4 totaltotal 71.1% 32 / 45 CC 3 SCAR 5.6
CC
3
Cov
81%
_build_fields
3.0
_build_field_names
2.0
viewfields
2.0
CRAP 1.8
« SyForm/ViewFieldRole/Verify.pm ↑ Summary SyForm/Exception.pm »
1 package SyForm::View;
2 6 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 $SyForm::View::AUTHORITY = 'cpan:GETTY';
4 }
5 # ABSTRACT: Container for SyForm::Results and SyForm::ViewField
6 6 $SyForm::View::VERSION = '0.103';
7 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Tie::IxHash;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Module::Runtime qw( use_module );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 with qw(
12 MooX::Traits
13 SyForm::ViewRole::Success
14 SyForm::ViewRole::Verify
15 SyForm::ViewRole::HTML
16 SyForm::ViewRole::Bootstrap
17 );
18  
19 6 has results => (
20 is => 'ro',
21 required => 1,
22 handles => [qw(
23 syform
24 values
25 )],
26 );
27 26 ▶sub has_results { 1 } # results should be optional
Subroutine has_results: called CC=1 SCAR=0.0
Pod undocumented
28  
29 6 has field_names => (
30 is => 'lazy',
31 );
32  
33 0 ▶sub _build_field_names {
Subroutine _build_field_names: not called CC=1 SCAR=6.9
34 0 my ( $self ) = @_;
35 0 return [ map { $_->name } $self->fields->Values ];
36 }
37  
38 6 has fields => (
39 is => 'lazy',
40 init_arg => undef,
41 );
42 0 ▶sub viewfields { shift->fields }
Subroutine viewfields: not called CC=1 SCAR=6.9
Pod undocumented
43 6 ▶sub field { shift->fields->FETCH(@_) }
Subroutine field: called CC=1 SCAR=0.0
Pod undocumented
44 0 ▶sub viewfield { shift->fields->FETCH(@_) }
Subroutine viewfield: not called CC=1 SCAR=6.9
Pod undocumented
45  
46 3 ▶sub _build_fields {
Subroutine _build_fields: called CC=3 SCAR=11.0
47 3 my ( $self ) = @_;
48 3 my $fields = Tie::IxHash->new;
49 3 for my $field ($self->syform->fields->Values) {
50 13 ▶ $fields->Push(map { $_->name, $_ } $field->viewfields_for_view($self))
Branch: 1 branch
BranchTrueFalseTotal
if $field->can("viewfields_for_view") 13 0 13
51 if $field->can('viewfields_for_view');
52 }
53 3 return $fields;
54 }
55  
56 6 1;
57  
58 __END__
« SyForm/ViewFieldRole/Verify.pm ↑ Summary SyForm/Exception.pm »