Chloro/Result/Group.pm

filter: Statementstmt 100% 41 / 41 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 1 / 1 totaltotal 98.2% 56 / 57 CC 3 SCAR 2.7
CC
3
Cov
98%
key_value_pairs
2.0
_build_is_valid
2.0
BEGIN
1.0
CRAP 1.3
« Chloro.pm ↑ Summary Chloro/Field.pm »
1 package Chloro::Result::Group;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 11 our $VERSION = '0.07';
8  
9 11 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 11 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 11 ▶use Chloro::Error::Field;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 11 ▶use Chloro::Types qw( Bool NonEmptyStr );
Subroutine BEGIN: called CC=1 SCAR=0.0
14 11 ▶use List::AllUtils qw( any );
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 11 with qw( Chloro::Role::Result Chloro::Role::ResultSet );
17  
18 11 has group => (
19 is => 'ro',
20 isa => 'Chloro::Group',
21 required => 1,
22 );
23  
24 11 has key => (
25 is => 'ro',
26 isa => NonEmptyStr,
27 required => 1,
28 );
29  
30 11 has prefix => (
31 is => 'ro',
32 isa => NonEmptyStr,
33 required => 1,
34 );
35  
36 11 has is_valid => (
37 is => 'ro',
38 isa => Bool,
39 init_arg => undef,
40 lazy => 1,
41 builder => '_build_is_valid',
42 );
43  
44 6 ▶sub _build_is_valid {
Subroutine _build_is_valid: called CC=2 SCAR=6.9
45 6 my $self = shift;
46  
47 6 ▶ return 0 if any { !$_->is_valid() } $self->_result_values();
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if &any(sub { not $_->is_valid; } , $self->_result_values) 1 5 6
48  
49 5 return 1;
50 }
51  
52 6 ▶sub key_value_pairs {
Subroutine key_value_pairs: called CC=2 SCAR=7.0
Pod documented
53 6 my $self = shift;
54 6 my $skip_secure = shift;
55  
56 20 return map { $_->key_value_pairs() }
57 6 ▶ grep { $skip_secure ? !$_->field()->is_secure() : 1 }
Branch: 1 branch
BranchTrueFalseTotal
$skip_secure ? : 0 20 20
58 $self->_result_values();
59 }
60  
61 11 __PACKAGE__->meta()->make_immutable();
62  
63 11 1;
64  
65 # ABSTRACT: A result for a single group
66  
67 __END__
« Chloro.pm ↑ Summary Chloro/Field.pm »