| 1 | package Catmandu::Fix::eval; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Catmandu::Sane; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | our $VERSION = '1.2025'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use List::Util qw(all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Catmandu::Fix; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Catmandu::Util qw(is_string is_array_ref); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Catmandu::Util::Path qw(as_path); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Catmandu::Fix::Has; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | has path => (fix_arg => 1); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1 | with 'Catmandu::Fix::Builder'; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 5 | ▶ | sub _build_fixer { | ||||||||||||||||||||||||||
|
Subroutine
_build_fixer: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 5 | my ($self) = @_; | |||||||||||||||||||||||||||
| 21 | 5 | my $getter = as_path($self->path)->getter; | |||||||||||||||||||||||||||
| 22 | 5 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||
| 23 | 5 | my $data = $_[0]; | |||||||||||||||||||||||||||
| 24 | 5 | for my $fixes (@{$getter->($data)}) { | |||||||||||||||||||||||||||
| 25 | 4 | ▶ | $fixes = [$fixes] unless is_array_ref($fixes); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 4 | ▶ | next unless @$fixes && all {is_string($_)} @$fixes; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
Condition66%2/3
@$fixes and &all(sub {
is_string($_);
}
, @$fixes)
MC/DC50%1/2
@$fixes and &all(sub {
is_string($_);
}
, @$fixes)
@$fixes
&all(sub {
is_string($_);
}
, @$fixes)
Truth table66%2/3
A and B
A= @$fixesB= &all(sub {
is_string($_);
}
, @$fixes)
| |||||||||||||||||||||||||||||
| 27 | 3 | my $fixer = Catmandu::Fix->new(fixes => $fixes); | |||||||||||||||||||||||||||
| 28 | 3 | $data = $fixer->fix($data); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 5 | $data; | |||||||||||||||||||||||||||
| 31 | 5 | }; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | 1; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | __END__ | ||||||||||||||||||||||||||||