Branch Coverage

blib/lib/Data/Transmute.pm
Criterion Covered Total %
branch 127 134 94.7


line true false branch
22 13 38 unless ref $data eq 'HASH'
24 1 37 unless defined $name
26 7 30 if (exists $data->{$name})
27 1 6 if $args{'ignore'}
28 1 5 unless $args{'replace'}
31 1 1 unless exists $args{'value'} or $args{'value_code'}
32 1 33 $args{'value_code'} ? :
37 1 23 if $args{'value_code'}
38 1 22 if $args{'ignore'}
39 1 21 if $args{'replace'}
47 2 19 unless ref $data eq 'HASH'
49 1 18 unless defined $from
51 1 17 unless defined $to
54 0 17 if $from eq $to
56 2 15 unless (exists $data->{$from})
57 1 1 unless $args{'ignore_missing_from'}
60 3 12 if (exists $data->{$to})
61 1 2 if $args{'ignore_existing_target'}
62 1 1 unless $args{'replace'}
69 1 9 if $args{'ignore_missing_from'}
70 1 8 if $args{'ignore_existing_target'}
71 1 7 if $args{'replace'}
83 2 7 unless ref $data eq 'HASH'
85 1 6 unless defined $name
90 0 1 unless exists $args{'to'} or $args{'to_code'}
94 5 1 $from_exists ? :
1 5 $args{'to_code'} ? :
96 1 5 unless (exists $data->{$name})
102 1 4 if $args{'to_code'}
104 4 1 if ($from_exists)
106 0 4 unless Data::Cmp::cmp_data($from, $to)
108 1 3 if (Data::Cmp::cmp_data($cur, $from))
118 1 3 unless exists $args{'from'}
119 1 2 if $args{'to_code'}
129 2 31 unless ref $data eq 'HASH'
131 1 30 unless defined $name
144 2 13 unless ref $data eq 'ARRAY'
147 1 12 unless defined $args{'rules'} or defined $args{'rules_module'}
153 6 26 if (defined $args{'index_is'})
154 4 2 unless $idx == $args{'index_is'}
156 6 22 if (defined $args{'index_in'})
157 2 4 unless grep {$idx == $_;} @{$args{'index_in'};}
159 6 20 if (defined $args{'index_match'})
160 2 4 unless $idx =~ /$args{'index_match'}/
162 6 18 if (defined $args{'index_filter'})
163 2 4 unless $args{'index_filter'}->('index', $idx, 'array', $data, 'rules', $args{'rules'})
193 2 13 unless ref $data eq 'HASH'
196 1 12 unless defined $args{'rules'} or defined $args{'rules_module'}
200 6 26 if (defined $args{'key_is'})
201 4 2 unless $key eq $args{'key_is'}
203 6 22 if (defined $args{'key_in'})
204 2 4 unless grep {$key eq $_;} @{$args{'key_in'};}
206 6 20 if (defined $args{'key_match'})
207 2 4 unless $key =~ /$args{'key_match'}/
209 6 18 if (defined $args{'key_filter'})
210 2 4 unless $args{'key_filter'}->('key', $key, 'hash', $data, 'rules', $args{'rules'})
245 8 8 unless my $ref = ref $data
247 0 8 if $seen->{$refaddr}++
249 4 4 if ($ref eq 'ARRAY') { }
4 0 elsif ($ref eq 'HASH') { }
266 0 1 unless defined $args{'rules'} or defined $args{'rules_module'}
281 7 175 unless ($rules)
282 6 1 if (defined $args->{'rules_module'})
289 1 181 unless $rules
296 1 133 unless exists $args{'data'}
303 0 146 if ($ENV{'LOG_DATA_TRANSMUTE_STEP'})
309 1 145 unless defined &{$funcname;}