Branch Coverage

blib/lib/Data/Sorting.pm
Criterion Covered Total %
branch 80 156 51.2


line true false branch
150 3 0 ref $_[0] eq 'ARRAY' ? :
0 3 !defined($_[0]) ? :
268 0 0 if (scalar @rules == 1) { }
290 0 0 if (not $descriptor) { }
0 0 elsif (ref $descriptor eq 'CODE') { }
0 0 elsif (not ref $descriptor) { }
296 0 0 unless $desc_func = \&{"_desc_$descriptor";}
314 0 0 $_ ? :
0 0 $$rule{'order_sign'} < 0 ? :
0 0 ref $comp eq 'ARRAY' ? :
0 0 ref $comp eq 'CODE' ? :
0 0 !ref($comp) ? :
420 36 35 if ($flagname and $SupportedOptions{$flagname}) { }
0 35 elsif ($flagname eq 'sortkey') { }
1 34 elsif (ref $token eq 'HASH') { }
430 24 27 unless (scalar @rules)
439 0 59 unless $compare
441 0 59 ref $compare eq 'CODE' ? :
445 7 52 $$rule{'order'} =~ /^desc|^rev/i ? :
449 0 59 unless length $extract
450 3 56 if $extract eq 'any' and ref $$rule{'sortkey'} eq 'CODE'
452 0 59 ref $extract eq 'CODE' ? :
457 36 23 ref $skey eq 'ARRAY' ? :
0 59 !defined($skey) ? :
461 1 58 if ($extract eq 'compound')
464 2 0 unless (ref $xa)
473 36 22 unless $$_{'compare'} ne 'cmp'
478 23 4 scalar @rules == 1 ? :
23 27 !grep({$$_{'order_sign'} < 0 unless $$_{'compare'} ne 'cmp';} @rules) ? :
1 50 @rules == 1 && $rules[0]{'order_sign'} > 0 && $rules[0]{'compare'} eq 'cmp' && $rules[0]{'extract'} eq 'self' ? :
0 51 $rules[0]{'engine'} ? :
0 51 defined $Data::Sorting::PreCalculate ? :
484 0 51 ref $engine eq 'CODE' ? :
535 352 0 defined $value ? :
541 0 0 defined $_ ? :
548 91 22 if $$rule{'extract'} eq 'self'
549 231 0 defined $_ ? :
567 88 0 $#sortkey ? :
590 0 1188 if (not ref $item) { }
924 264 elsif (UNIVERSAL::isa($item, 'HASH')) { }
264 0 elsif (UNIVERSAL::isa($item, 'ARRAY')) { }
595 0 264 unless $index eq '0' or $index != 0
609 0 1100 if (ref $item eq 'CODE') { }
0 1100 elsif (not scalar @sortkey) { }
0 1100 elsif (ref $sortkey[0] eq 'CODE') { }
132 968 elsif (UNIVERSAL::can($item, $sortkey[0])) { }
968 0 elsif (not ref $sortkey[0]) { }
629 88 0 $sortkey ? :
700 0 0 !length($Data::Sorting::ValueSet[$b]) ? :
0 0 !length($Data::Sorting::ValueSet[$b]) ? :
0 0 !length($Data::Sorting::ValueSet[$a]) ? :
712 0 0 unless defined $$is_numeric[$a]
714 0 0 unless defined $$is_numeric[$b]
720 0 0 $$is_numeric[$b] ? :
0 0 $$is_numeric[$b] ? :
0 0 $$is_numeric[$a] ? :
733 0 0 if defined $$mangled[$idx]
743 0 0 length $$mangled[$b] ? :
0 0 length $$mangled[$b] ? :
0 0 length $$mangled[$a] ? :
767 0 0 if defined $rc
783 0 22 !length($Data::Sorting::ValueSet[$b]) ? :
24 2258 !length($Data::Sorting::ValueSet[$b]) ? :
22 2282 !length($Data::Sorting::ValueSet[$a]) ? :
792 378 1880 unless defined $$is_numeric[$a]
794 403 1855 unless defined $$is_numeric[$b]
800 1562 122 $$is_numeric[$b] ? :
87 487 $$is_numeric[$b] ? :
1684 574 $$is_numeric[$a] ? :
810 754 220 if defined $$mangled[$idx]
821 487 0 length $$mangled[$b] ? :
0 0 length $$mangled[$b] ? :
487 0 length $$mangled[$a] ? :
895 77 5745 unless my $rc = &{$$Data::Sorting::Rule{'compare_func'};}
916 176 116 unless defined $Data::Sorting::ValueSet[$a]
917 176 116 unless defined $Data::Sorting::ValueSet[$b]
920 88 204 unless my $rc = &{$$Data::Sorting::Rule{'compare_func'};}
933 209 44 if (@Data::Sorting::Rules == 1) { }