TreeValidator/Result/Branch.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 38 / 38 CC 2 SCAR 2.2
CC
2
Cov
100%
valid
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« TreeValidator/Transformations.pm ↑ Summary TreeValidator/RepeatingBranch.pm »
1 package Data::TreeValidator::Result::Branch;
2 {
3 6 $Data::TreeValidator::Result::Branch::VERSION = '0.04';
4 }
5 # ABSTRACT: Contains the result of processing a branch
6 6 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use Data::TreeValidator::Types qw( Result );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use MooseX::Types::Moose qw( Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use MooseX::Types::Structured qw( Map );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 6 with 'Data::TreeValidator::Result';
14  
15 6 has 'results' => (
16 isa => Map[Str, Result],
17 traits => [ 'Hash' ],
18 handles => {
19 results => 'values',
20 result_names => 'keys',
21 result_count => 'count',
22 result => 'get',
23 }
24 );
25  
26 23 ▶sub valid {
Subroutine valid: called CC=2 SCAR=6.9
Pod documented
27 23 my $self = shift;
28 ($self->errors == 0) &&
29 23 ▶ (grep { $_->valid } $self->results) == $self->result_count;
Branch: 1 branch
BranchTrueFalseTotal
$self->errors == 0 and grep({$_->valid;} $self->results) == $self->result_count 22 1 23
30 }
31  
32 24 ▶sub clean {
Subroutine clean: called CC=1 SCAR=0.0
Pod documented
33 24 my $self = shift;
34 return {
35 map {
36 38 $_ => $self->result($_)->clean
37 } grep {
38 24 $self->result($_)->valid
39 } $self->result_names
40 }
41 }
42  
43 6 1;
44  
45  
46  
47 __END__
« TreeValidator/Transformations.pm ↑ Summary TreeValidator/RepeatingBranch.pm »