Branch Coverage

blib/lib/CPAN/Meta/Converter.pm
Criterion Covered Total %
branch 194 242 80.1


line true false branch
38 0 13 if (my $err = $@)
39 0 0 unless eval 'use ExtUtils::MakeMaker::version'
55 8676 3798 unless my $reftype = ref $ref
57 3503 295 defined $_CLONE_DEPTH ? :
58 0 3798 if $_CLONE_DEPTH == 0
60 509 3289 if 'ARRAY' eq $reftype
61 3277 12 if 'HASH' eq $reftype
63 0 12 if ('SCALAR' eq $reftype)
69 10 2 if (eval { do { $ref->can('TO_JSON') } })
71 10 0 ref $data ? :
101 384 160 defined $_[0] ? :
103 0 0 defined $_[0] ? :
105 376 63 defined $_[0] && length $_[0] ? :
111 5 496 unless defined $gen and length $gen
112 287 209 if $gen =~ /\Q$sig\E/
116 476 48 ref $_[0] eq 'ARRAY' ? :
276 524 !defined($_[0]) ? :
128 0 6 unless $key =~ /[A-Z]/
176 24 351 unless defined $element
177 351 0 if ($license_map_1{lc $element}) { }
232 20 116 unless defined $element
233 78 38 unless ref $element eq 'ARRAY'
236 0 121 unless defined $lic
237 121 0 if (my $new = $license_map_2{lc $lic})
241 116 0 @new_list ? :
276 0 33 if (not defined $element) { }
33 0 elsif (ref $element eq 'ARRAY') { }
0 0 elsif (not ref $element) { }
280 6 27 if (@$element > 1) { }
27 0 elsif (@$element == 1) { }
281 0 6 if (grep {not $is_open_source{$license_downgrade_map{lc $_} or 'unknown'};} @$element) { }
323 73 21 unless $no_index
326 0 21 if (not ref $no_index) { }
0 21 elsif (ref $no_index eq 'ARRAY') { }
336 0 21 if (exists $no_index->{'files'})
340 0 21 if (exists $no_index->{'modules'})
348 278 67 unless $element
351 0 67 if (not ref $element) { }
2 65 elsif (ref $element eq 'ARRAY') { }
360 0 67 if (exists $element->{'dir'})
364 0 67 if (exists $element->{'files'})
368 0 67 if (exists $element->{'modules'})
371 24 43 $version == 2 ? :
377 0 12031 unless defined $mod and length $mod
383 58 1619 unless defined $element
389 0 1619 unless length $element
390 0 1619 if $element eq 'undef' or $element eq ''
395 1619 0 if (defined $v) { }
396 0 1619 _is_qv($v) ? :
409 4 48 defined $vobj ? :
414 1345 1142 unless defined $element
415 1137 5 if (ref $element eq 'HASH') { }
5 0 elsif (ref $element eq 'ARRAY') { }
0 0 elsif (ref $element eq '' and length $element) { }
422 5 6013 unless _is_module_name($k)
423 0 6013 if (not defined $v && length $v or $v eq 'undef' or $v eq '')
428 12 6001 if (_is_module_name($v) and not version::is_lax($v))
452 56 116 if $meta->{$key}
456 100 158 if $meta->{$rel}
480 22 63 unless $prereqs and ref $prereqs eq 'HASH'
486 188 127 unless $relation and ref $relation eq 'HASH'
502 39 13 unless (defined $type)
525 0 318 unless ref $prereqs eq 'HASH'
531 9 24 unless exists $meta->{'optional_features'}
544 96 48 unless defined $features->{$name}{$k}
552 72 4 unless exists $meta->{'optional_features'}
573 0 25 unless $element and ref $element eq 'HASH'
579 35 25 unless $element and ref $element eq 'HASH'
584 0 25 unless keys %$new_data
590 67 4 unless $element
602 155 48 unless $element
603 4 44 if (ref $element eq 'ARRAY')
614 380 433 if defined $_[0]
618 290 413 if _is_urlish($element)
624 8 30 unless $element
627 0 30 unless @$element
633 56 383 unless $element
635 575 0 defined $_ && length $_ ? :
636 0 383 unless @$element
656 39 37 unless exists $meta->{'resources'}
668 3 18 if defined $element
669 1 17 unless exists $meta->{'url'}
672 16 17 if $repo_url =~ /\A$type/
694 22 38 unless $resources and ref $resources eq 'HASH'
708 110 129 unless exists $meta->{'resources'}
717 1 30 if ($meta->{'license_url'} and not $resources->{'license'})
719 1 0 if _is_urlish($meta->{'license_url'})
721 29 2 unless keys %$resources
735 6 27 unless exists $meta->{'resources'}
741 32 104 if $element and $element =~ /\A(?:stable|testing|unstable)\z/
748 15 89 $version =~ /_/ ? :
764 319 120 unless defined $element and ref $element eq 'HASH'
765 44 76 $to_version == 2 ? :
770 1677 59 if exists $element->{$k}{'version'}
780 1969 14664 if $key eq ':custom' or $key eq ':drop'
781 0 14664 unless my $fcn = $spec->{$key}
782 43 14621 if ($is_fragment and $key eq 'generated_by')
785 0 14664 unless ref $fcn and ref $fcn eq 'CODE'
788 10073 4591 if defined $new_value
795 428 10302 if $drop_list and grep {$key eq $_;} @$drop_list
796 9553 749 if exists $spec->{$key}
1354 62 432 unless defined $spec and ref $spec eq 'HASH'
1358 426 6 if (defined $v and $v =~ /^\d+(?:\.\d+)?$/)
1359 410 16 if defined $v and grep {$v eq $_;} keys %known_specs
1360 11 5 if defined $v and grep {$v == $_;} keys %known_specs
1364 5 6 if exists $data->{'prereqs'}
1365 0 6 if exists $data->{'configure_requires'}
1427 70 181 if ($old_version == $new_version) { }
81 100 elsif ($old_version > $new_version) { }
1429 39 31 unless ($args->{'is_fragment'})
1431 0 39 unless ($cmv->is_valid)
1441 80 266 if $vers[$i] > $old_version
1442 37 229 if $vers[$i + 1] < $new_version
1445 229 0 unless ($args->{'is_fragment'})
1447 5 224 unless ($cmv->is_valid)
1458 225 265 if $vers[$i] < $old_version
1459 20 245 if $vers[$i + 1] > $new_version
1462 233 12 unless ($args->{'is_fragment'})
1464 5 228 unless ($cmv->is_valid)
1496 41 254 if $key =~ /^x_/i or $key eq 'meta-spec'
1497 122 132 unless $expected{$key}