Catmandu/Fix/Condition/all_match.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 97.3% 37 / 38 CC 2 SCAR 2.1
CC
2
Cov
97%
__ANON__
2.1
_build_value_tester
1.0
BEGIN
1.0
CRAP 1.2
« Catmandu/Importer/JSON.pm ↑ Summary Catmandu/Fix/add_to_exporter.pm »
1 package Catmandu::Fix::Condition::all_match;
2  
3 6 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 6 our $VERSION = '1.2025';
6  
7 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Catmandu::Util qw(is_value);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Catmandu::Util::Regex qw(as_regex);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 6 has path => (fix_arg => 1);
14 6 has pattern => (fix_arg => 1);
15  
16 6 with 'Catmandu::Fix::Condition::Builder::Simple';
17  
18 11 ▶sub _build_value_tester {
Subroutine _build_value_tester: called CC=1 SCAR=0.0
19 11 my ($self) = @_;
20 11 my $re = as_regex($self->pattern);
21 33 ▶ sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
22 33 my $v = $_[0];
23 33 ▶ is_value($v) && $v =~ $re;
Branch: 1 branch
BranchTrueFalseTotal
is_value($v) and $v =~ /$re/ 33 0 33
24 11 };
25 }
26  
27 6 1;
28  
29 __END__
« Catmandu/Importer/JSON.pm ↑ Summary Catmandu/Fix/add_to_exporter.pm »