lib/Reaction/UI/ViewPort/Field/Array.pm

filter: Statementstmt 69.2% 18 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod n/a totaltotal 62.8% 22 / 35 CC 2 SCAR 9.2
CC
2
Cov
64%
_build_value_names
6.0
__ANON__
2.0
_empty_value
2.0
CRAP 2.5
« lib/Reaction/UI/ViewPort/Action/Link.pm ↑ Summary lib/Reaction/UI/ViewPort/Object/Mutable.pm »
1 package Reaction::UI::ViewPort::Field::Array;
2  
3 5 ▶use Reaction::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 extends 'Reaction::UI::ViewPort::Field';
7  
8 5 ▶use namespace::clean -except => [ qw(meta) ];
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 ▶use MooseX::Types::Moose qw/Str ArrayRef/;;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 5 has '+value' => (isa => ArrayRef);
13  
14 5 has value_names => (isa => ArrayRef, is => 'ro', lazy_build => 1);
15 has value_map_method => (
16 0 ▶ isa => Str, is => 'ro', required => 1, default => sub { 'display_name' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
17 5 );
18  
19 0 ▶sub _build_value_names {
Subroutine _build_value_names: not called CC=2 SCAR=17.9
20 0 my $self = shift;
21 0 my $meth = $self->value_map_method;
22 0 ▶ my @names = map { blessed($_) ? $_->$meth : $_ } @{ $self->value };
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) ? : 0 0 0
23 0 return [ sort @names ];
24 }
25  
26 0 ▶sub _empty_value { [] }
Subroutine _empty_value: not called CC=1 SCAR=6.9
27  
28 5 __PACKAGE__->meta->make_immutable;
29  
30  
31 5 1;
« lib/Reaction/UI/ViewPort/Action/Link.pm ↑ Summary lib/Reaction/UI/ViewPort/Object/Mutable.pm »