Catmandu/Fix/Condition/exists.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 33 / 33 CC 2 SCAR 2.2
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Catmandu/Flushable.pm ↑ Summary Catmandu/Fix/Condition/is_string.pm »
1 package Catmandu::Fix::Condition::exists;
2  
3 17 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 17 our $VERSION = '1.2025';
6  
7 17 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 17 ▶use Catmandu::Util::Path qw(as_path);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 17 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 17 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 17 has path => (fix_arg => 1);
13  
14 17 with 'Catmandu::Fix::Condition::Builder';
15  
16 44 ▶sub _build_tester {
Subroutine _build_tester: called CC=1 SCAR=0.0
17 44 my ($self) = @_;
18 44 my $getter = as_path($self->path)->getter;
19 78 ▶ sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
20 78 ▶ @{$getter->($_[0])} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
@{&$getter($_[0]);} ? : 60 18 78
21 44 };
22 }
23  
24 17 1;
25  
26 __END__
« Catmandu/Flushable.pm ↑ Summary Catmandu/Fix/Condition/is_string.pm »