| 1 | package Catmandu::Fix::Bind::mab_each; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | our $VERSION = '0.24'; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Catmandu::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | with 'Catmandu::Fix::Bind', 'Catmandu::Fix::Bind::Group'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | has done => (is => 'ro'); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | sub unit { | ||||||||||||||||||||||||||
|
Subroutine
unit: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 1 | my ($self,$data) = @_; | |||||||||||||||||||||||||||
| 14 | 1 | $self->{done} = 0; | |||||||||||||||||||||||||||
| 15 | 1 | $data; | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | sub bind { | ||||||||||||||||||||||||||
|
Subroutine
bind: called CC=7 SCAR=20.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | 1 | my ($self,$mvar,$code) = @_; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 1 | ▶ | return $mvar if $self->done; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | ▶ | my $rows = $mvar->{record} // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$mvar->{"record"} // []
MC/DC0%0/1
$mvar->{"record"} // []
$mvar->{"record"}
Truth table50%1/2
A
A= $mvar->{"record"}
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | my @new = (); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 1 | for my $row (@{$rows}) { | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 70 | $mvar->{record} = [$row]; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 70 | my $fixed = $code->($mvar); | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 70 | ▶ | push @new , @{$fixed->{record}} if defined($fixed) && exists $fixed->{record}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $fixed and exists $fixed->{"record"}
MC/DC0%0/2
defined $fixed and exists $fixed->{"record"}
defined $fixed
exists $fixed->{"record"}
Truth table33%1/3
A and B
A= defined $fixedB= exists $fixed->{"record"}
| |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 1 | ▶ | $mvar->{record} = \@new if exists $mvar->{record}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | $self->{done} = 1; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | $mvar; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 1 | 1; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | __END__ | ||||||||||||||||||||||||||||