lib/Reaction/UI/ViewPort/Object/Mutable.pm

filter: Statementstmt 65.8% 56 / 85 Branchbran 33.3% 2 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 18 / 30 Podpod 100% 1 / 1 totaltotal 63.1% 77 / 122 CC 5 SCAR 8.9
CC
5
Cov
64%
is_modified
12.0
_build_fields_for_type_Str
2.1
_build_fields_for_type_ArrayRef
2.1
CRAP 2.4
« lib/Reaction/UI/ViewPort/Field/Array.pm ↑ Summary lib/Reaction/UI/ViewPort/Field/Role/Choices.pm »
1 package Reaction::UI::ViewPort::Object::Mutable;
2  
3 4 ▶use Reaction::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use aliased 'Reaction::UI::ViewPort::Object';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::Text';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::Array';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::String';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::Number';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::Integer';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::Boolean';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::Password';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::DateTime';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::ChooseOne';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::ChooseMany';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use aliased 'Reaction::UI::ViewPort::Field::Mutable::File';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 4 ▶use namespace::clean -except => [ qw(meta) ];
Subroutine BEGIN: called CC=1 SCAR=0.0
19 4 extends Object;
20  
21 #this her for now. mutable fields need an action to build correctly
22 4 has model => (
23 is => 'ro',
24 isa => 'Reaction::InterfaceModel::Action',
25 required => 1,
26 );
27  
28 0 ▶sub is_modified {
Subroutine is_modified: not called CC=3 SCAR=24.8
Pod documented
29 0 my $self = shift;
30 0 foreach my $field (@{$self->fields}) {
31 0 ▶ return 1 if $field->is_modified;
Branch: 1 branch
BranchTrueFalseTotal
if $field->is_modified 0 0 0
32 }
33 0 return 0;
34 }
35  
36 0 ▶sub _build_fields_for_type_Num {
Subroutine _build_fields_for_type_Num: not called CC=1 SCAR=6.9
37 0 my ($self, $attr, $args) = @_;
38 0 $self->_build_simple_field(attribute => $attr, class => Number, %$args);
39 }
40  
41 0 ▶sub _build_fields_for_type_Int {
Subroutine _build_fields_for_type_Int: not called CC=1 SCAR=6.9
42 0 my ($self, $attr, $args) = @_;
43 0 $self->_build_simple_field(attribute => $attr, class => Integer, %$args);
44 }
45  
46 3 ▶sub _build_fields_for_type_Bool {
Subroutine _build_fields_for_type_Bool: called CC=1 SCAR=0.0
47 3 my ($self, $attr, $args) = @_;
48 3 $self->_build_simple_field(attribute => $attr, class => Boolean, %$args);
49 }
50  
51 0 ▶sub _build_fields_for_type_Reaction_Types_Core_SimpleStr {
Subroutine _build_fields_for_type_Reaction_Types_Core_SimpleStr: not called CC=1 SCAR=6.9
52 0 my ($self, $attr, $args) = @_;
53 0 $self->_build_simple_field(attribute => $attr, class => String, %$args);
54 }
55  
56 0 ▶sub _build_fields_for_type_Reaction_Types_File_File {
Subroutine _build_fields_for_type_Reaction_Types_File_File: not called CC=1 SCAR=6.9
57 0 my ($self, $attr, $args) = @_;
58 0 $self->_build_simple_field(attribute => $attr, class => File, %$args);
59 }
60  
61 3 ▶sub _build_fields_for_type_Str {
Subroutine _build_fields_for_type_Str: called CC=2 SCAR=7.6
62 3 my ($self, $attr, $args) = @_;
63 3 ▶ if ($attr->has_valid_values) { # There's probably a better way to do this
Branch: 1 branch
BranchTrueFalseTotal
if ($attr->has_valid_values) { } 0 3 3
64 0 $self->_build_simple_field(attribute => $attr, class => ChooseOne, %$args);
65 } else {
66 3 $self->_build_simple_field(attribute => $attr, class => Text, %$args);
67 }
68 }
69  
70 0 ▶sub _build_fields_for_type_Reaction_Types_Core_Password {
Subroutine _build_fields_for_type_Reaction_Types_Core_Password: not called CC=1 SCAR=6.9
71 0 my ($self, $attr, $args) = @_;
72 0 $self->_build_simple_field(attribute => $attr, class => Password, %$args);
73 }
74  
75 0 ▶sub _build_fields_for_type_Reaction_Types_DateTime_DateTime {
Subroutine _build_fields_for_type_Reaction_Types_DateTime_DateTime: not called CC=1 SCAR=6.9
76 0 my ($self, $attr, $args) = @_;
77 0 $self->_build_simple_field(attribute => $attr, class => DateTime, %$args);
78 }
79  
80 0 ▶sub _build_fields_for_type_Enum {
Subroutine _build_fields_for_type_Enum: not called CC=1 SCAR=6.9
81 0 my ($self, $attr, $args) = @_;
82 0 $self->_build_simple_field(attribute => $attr, class => ChooseOne, %$args);
83 }
84  
85 #this needs to be fixed. somehow. beats the shit our of me. really.
86 #implements build_fields_for_type_Reaction_InterfaceModel_Object => as {
87 0 ▶sub _build_fields_for_type_DBIx_Class_Row {
Subroutine _build_fields_for_type_DBIx_Class_Row: not called CC=1 SCAR=6.9
88 0 my ($self, $attr, $args) = @_;
89 0 $self->_build_simple_field(attribute => $attr, class => ChooseOne, %$args);
90 }
91  
92 3 ▶sub _build_fields_for_type_ArrayRef {
Subroutine _build_fields_for_type_ArrayRef: called CC=2 SCAR=7.6
93 3 my ($self, $attr, $args) = @_;
94 3 ▶ if ($attr->has_valid_values) {
Branch: 1 branch
BranchTrueFalseTotal
if ($attr->has_valid_values) { } 3 0 3
95 3 $self->_build_simple_field(attribute => $attr, class => ChooseMany, %$args);
96 } else {
97 0 $self->_build_simple_field
98 (
99 attribute => $attr,
100 class => Array,
101 layout => 'field/mutable/hidden_array',
102 %$args);
103 }
104 }
105  
106 3 ▶sub _build_fields_for_type_MooseX_Types_Common_String_SimpleStr {
Subroutine _build_fields_for_type_MooseX_Types_Common_String_SimpleStr: called CC=1 SCAR=0.0
107 3 my ($self, $attr, $args) = @_;
108 3 $self->_build_simple_field(attribute => $attr, class => String, %$args);
109 }
110  
111 0 ▶sub _build_fields_for_type_MooseX_Types_Common_String_Password {
Subroutine _build_fields_for_type_MooseX_Types_Common_String_Password: not called CC=1 SCAR=6.9
112 0 my ($self, $attr, $args) = @_;
113 0 $self->_build_simple_field(attribute => $attr, class => Password, %$args);
114 }
115  
116 0 ▶sub _build_fields_for_type_MooseX_Types_DateTime_DateTime {
Subroutine _build_fields_for_type_MooseX_Types_DateTime_DateTime: not called CC=1 SCAR=6.9
117 0 my ($self, $attr, $args) = @_;
118 0 $self->_build_simple_field(attribute => $attr, class => DateTime, %$args);
119 }
120  
121 0 ▶sub _build_fields_for_type_DateTime {
Subroutine _build_fields_for_type_DateTime: not called CC=1 SCAR=6.9
122 0 my ($self, $attr, $args) = @_;
123 0 $self->_build_simple_field(attribute => $attr, class => DateTime, %$args);
124 }
125  
126 4 __PACKAGE__->meta->make_immutable;
127  
128 4 1;
129  
130 __END__;
« lib/Reaction/UI/ViewPort/Field/Array.pm ↑ Summary lib/Reaction/UI/ViewPort/Field/Role/Choices.pm »