Branch Coverage

blib/lib/Sub/MultiMethod.pm
Criterion Covered Total %
branch 108 136 79.4


line true false branch
30 33 338 unless ($CANDIDATES{$target})
44 6 345 ref $method_name ? :
53 0 2 ref $method_name ? :
74 0 111 if (@$mmc and $spec->{'method'} != $mmc->[0]{'method'})
92 11 48 if (is_Int($method_name) or is_ScalarRef($method_name)) { }
98 46 2 $is_method ? :
111 84 55 if ($found) { }
55 0 elsif (not $is_coderef_method) { }
116 8 47 if (exists &{"${p}::$method_name";})
119 8 0 unless ($me->known_dispatcher($coderef))
134 8 51 if (defined $final_fallback)
177 0 36 if (ref $target or not defined $target)
182 0 36 unless $args->{'defaults'}
187 22 29 if ($defaults{'no_dispatcher'} eq "auto")
245 256 65 $keep_while_copying{$_} ? :
264 7 0 $first ? :
274 0 2 unless ref $spec{'alias'}
285 40 11 unless defined $spec{'method'}
291 47 4 if defined $sub_name
294 8 43 if ($spec{'alias'})
295 6 2 unless is_ArrayRef($spec{'alias'})
297 0 8 unless my $next = $spec{'code'}
300 0 8 if (is_CodeRef($spec{'signature'})) { }
305 0 8 if (is_HashRef($sig[0]) and not $sig[0]{'slurpy'})
326 0 8 $spec{'named'} ? :
331 0 8 unless eval $code
337 2 6 exists &{"${target}::$alias";} ? :
340 2 6 if ($existing)
341 1 1 $spec{'is_monomethod'} && $alias eq $aliases[0] ? :
352 34 15 if defined $sub_name and not $spec{'no_dispatcher'}
354 5 42 if (not $hooked{$target} and "Role::Hooks"->is_role($target))
358 7 3 unless "Role::Hooks"->is_role($consumerpkg)
371 7 22 if (is_ScalarRef($sub_name)) { }
22 0 elsif (is_Str($sub_name)) { }
372 2 5 if (is_Undef($$sub_name)) { }
5 0 elsif (is_CodeRef($$sub_name) or is_Object($$sub_name)) { }
379 5 0 if ($me->known_dispatcher($$sub_name)) { }
406 0 2 unless $CLEANUP{"$blessed_coderef"}
407 2 0 if ($target and $sub_name)
420 0 41 unless (exists &mro::get_linear_isa or eval {
425 18 23 exists &{"${target}::$sub_name";} ? :
429 0 41 unless defined $sub_name
431 16 25 if ($existing and $me->known_dispatcher($existing)) { }
2 23 elsif ($existing) { }
439 6 17 ref $sub_name ? :
460 0 23 unless eval $code
477 39 20 if ($is_method and is_Object($invocants[0])) { }
5 28 elsif ($is_method and &is_ClassName($invocants[0])) { }
490 3 56 unless (my($winner, $new_argv, $new_invocants) = $me->pick_candidate([$me->get_all_multimethod_candidates($pkg, $method_name, $is_method)], $argv, \@invocants))
515 285 87 if $candidate->{'compiled'}
516 8 79 if (is_CodeRef($candidate->{'signature'})) { }
524 1 78 is_HashRef($sig[0]) && !$sig[0]{'slurpy'} ? :
529 1 78 $candidate->{'named'} ? :
534 1 78 if $opt->{'head'} or $opt->{'tail'}
547 0 372 if ($candidate->{'compiled'}{'_pure_named'} and not $argv_maybe_named) { }
7 365 elsif (defined $candidate->{'compiled'}{'min_args'} and $candidate->{'compiled'}{'min_args'} > $argc) { }
2 363 elsif (defined $candidate->{'compiled'}{'max_args'} and $candidate->{'compiled'}{'max_args'} < $argc) { }
579 28 31 if (@remaining > 1)
583 43 37 if defined $candidate->{'score'}
585 33 4 if (is_ArrayRef($candidate->{'signature'}))
587 0 48 unless is_Object($type)
600 10 49 if (@remaining > 1)
608 5 54 if (@remaining > 1)
616 4 55 if (@remaining > 1)
627 0 59 unless wantarray
629 3 56 unless @remaining
639 0 0 $candidate->{'named'} ? :
641 0 0 if defined $candidate->{'score'} or defined $candidate->{'height'}