Branch Coverage

blib/lib/Exporter/Extensible.pm
Criterion Covered Total %
branch 180 284 63.3


line true false branch
56 102 3 unless ref $self
59 55 50 if ref $_[0] eq 'HASH'
62 12 2 unless $self->exporter_get_tag('default')
91 14 @_ ? :
63 12 93 unless @todo
71 11 4 if ($replace eq 'carp') { }
2 2 elsif ($replace eq 1) { }
75 0 0 unless *{$prefix . $_;}{'CODE'} == $fastsub->{$_}
101 9 94 if (ref $flat_install[$i] eq 'HASH')
108 1 83 if (my $scope = $self->{'scope'})
128 13 126 if (ord $symbol == $colon)
130 0 13 unless my $tag_cache = $self->exporter_get_tag($name)
134 1 12 if (ref $tag_cache->[0] eq 'HASH' or ref $todo->[0] eq 'HASH')
137 0 1 if ref $tag_cache->[0] eq 'HASH'
139 1 0 if ref $todo->[0] eq 'HASH'
141 1 0 if ($self != $self2)
151 68 58 exists $inventory->{$symbol} ? :
0 126 unless my $ref = exists $inventory->{$symbol} ? $inventory->{$symbol} : $self->exporter_get_inherited($symbol)
155 39 87 if (ord $symbol == $hyphen) { }
157 4 35 if ($count eq '*') { }
3 32 elsif ($count eq '?') { }
159 0 4 unless $consumed =~ /^[0-9]+$/
163 1 2 if (ref $todo->[0]) { }
165 1 0 ref $arg eq 'HASH' ? :
176 31 56 $ord_is_sigil{ord $symbol} ? :
179 9 78 if ref $todo->[0] eq 'HASH'
181 33 54 if ($self2->{'_name_mangle'})
182 10 23 if defined $self2->{'not'} and $self2->_exporter_is_excluded($symbol)
185 5 11 unless defined $self2->{'prefix'} or defined $self2->{'suffix'} or defined $self2->{'not'}
189 6 71 if (ref $ref eq 'REF')
193 3 3 unless ref $method eq 'CODE'
199 0 0 unless ref $ref eq $sigil_to_reftype{$sigil} or ref $ref eq 'REF' and $sigil eq '$'
204 0 77 if ($install->{$name}) { }
9 68 elsif (ref $ref eq 'HASH') { }
205 0 0 if ($install->{$name} != $ref)
206 0 0 if (ref $ref eq 'GLOB' or ref $install->{$name} eq 'GLOB')
210 0 0 unless ref $ref eq 'GLOB' and ref $install->{'dest'} eq 'GLOB' and *{$install->{$name};} eq *$ref
214 0 0 unless ref $install->{$name} eq 'HASH'
216 0 0 unless ($install->{$name}{ref $ref} ||= $ref) == $ref
234 1 0 if $self->[1]
244 0 79 unless my $into = $self->{'into'}
245 2 77 if ref $into
248 77 0 @_ == 1 && ref $_[0] eq 'ARRAY' ? :
254 19 46 if (defined $stash->{$name} and $replace ne 1)
259 1 18 ref $ref eq 'SCALAR' ? :
0 19 ref $ref eq 'GLOB' ? :
260 4 15 if ($conflict)
261 1 3 if $replace eq 'skip'
263 1 2 $replace eq 'warn' ? :
273 0 8 unless my $into = $self->{'into'}
274 1 7 if ref $into
276 7 0 @_ == 1 && ref $_[0] eq 'ARRAY' ? :
281 1 8 if (ref $ref eq 'GLOB') { }
283 0 1 unless *$ref eq ($stash->{$name} || '')
289 0 8 unless $ref == (*{$pkg_dest;}{ref $ref} || 0)
301 0 3 unless ref $into eq 'HASH'
303 3 0 @_ == 1 && ref $_[0] eq 'ARRAY' ? :
307 1 5 if ($self->{'no'}) { }
311 0 5 if (defined $into->{$name} and $into->{'name'} != $ref)
312 0 0 if $replace eq 'skip'
313 0 0 if $replace eq 'warn'
314 0 0 if $replace eq 'die'
321 4 0 if @_ > 1
322 3 0 if @_ > 1
323 6 0 if @_ > 1
324 7 0 if @_ > 1
325 50 0 if @_ > 1
326 1 0 if @_ > 1
327 5 0 if @_ > 1
328 0 0 if @_ > 1
356 11 0 if @_ > 1
364 0 0 unless my $setter = $self->can('exporter_config_' . $k) or substr($k, 0, 1) eq '-' and $self->can('exporter_config_' . substr($k, 1))
376 5 4 if (@for_global_config == 1 and $for_global_config[0] eq '-as' and keys %$conf == 1)
383 0 6 unless my $setter = $self2->can('exporter_config_' . substr($k, 1))
389 2 4 if (@for_global_config < scalar keys %$conf)
398 2 5 ref $_[1] eq 'HASH' ? :
405 15 24 ref $_[0] eq 'HASH' ? :
411 0 4 unless $ref ||= $class->_exporter_get_ref_to_package_var($export_name)
451 0 7 if (ord $export_name == $colon) { }
452 0 0 unless (${$class . '::EXPORT_TAGS';}{substr $export_name, 1} ||= $method_name) eq $method_name
456 0 7 ref $method_name ? :
477 27 25 unless my $add = do { $_ . '::EXPORT_TAGS' }->{$tagname} || $tagname eq 'all' && defined *{$_ . '::EXPORT';}{'HASH'} && [grep((!$ord_is_directive{ord $_}), keys %{$_ . '::EXPORT';})]
481 1 24 if (ref $add ne 'ARRAY')
483 1 0 ref $add eq 'SCALAR' ? :
0 1 ref $add eq 'CODE' ? :
487 0 1 unless ref $add eq 'ARRAY'
492 0 25 @$add && !defined($add->[0]) ? :
497 0 25 if $start
499 14 12 $known ? :
500 25 1 unless $dynamic
510 26 0 unless $list or exists $EXPORT_TAGS_PKG_CACHE{$class}{$tagname}
516 0 20 unless ref $self and my $not = $self->{'not'}
519 4 16 ref $not eq 'ARRAY' ? :
520 8 14 if (not ref $filter) { }
6 8 elsif (ref $filter eq 'Regexp') { }
8 0 elsif (ref $filter eq 'CODE') { }
521 2 6 if $symbol eq $filter
524 4 2 if $symbol =~ /$filter/
541 0 3 unless ref $self and $self->{'todo'}
549 0 0 unless $method_attrs{$class}{$coderef}
0 0 $super ? :
556 0 19 $super ? :
562 0 0 unless &Sub::Identify::sub_name
565 0 0 eval 'require Sub::Identify;1' ? :
569 0 16 unless $cv->isa('B::CV') and not $cv->GV->isa('B::SPECIAL') and $cv->GV->NAME
0 0 unless $cv->isa('B::CV') and not $cv->GV->isa('B::SPECIAL') and $cv->GV->NAME
579 0 4 unless (defined $name)
580 0 0 unless ($sigil, $name) = $_[1] =~ /^([\$\@\%\*\&]?)(\w+)$/
584 0 4 unless do { $class . '::' }->{$name}
585 1 3 $reftype eq 'GLOB' ? :
590 20 0 if ($attr =~ /^Export(?:\(\s*(.*?)\s*\))?$/)
593 15 5 $1 ? :
594 7 16 if ($token =~ /^:(.*)$/) { }
6 10 elsif ($token =~ /^\w+$/) { }
3 7 elsif ($token =~ /^-(\w*)(?:\(([0-9]+|\*)\))?$/) { }
7 0 elsif (my($sym, $name) = $token =~ /^=([\&\$\@\%\*:]?(\w*))$/) { }
603 0 3 length $1 ? :
608 3 4 length $name ? :
620 6 14 unless (@export_names)
635 5 22 if ($version == 1) { }
0 22 elsif ($version) { }
642 0 5 if ref $tags->{'default'} eq 'ARRAY'
661 0 22 if ref $export
663 2 20 if ref $_[$i]
665 10 12 if ($export =~ /^\w+$/) { }
7 5 elsif (($is_gen, $sigil, $name) = $export =~ /^(=?)([\$\@\%\*]?)(\w+)$/) { }
1 4 elsif (($is_gen, $name) = $export =~ /^(=?):(\w+)$/) { }
4 0 elsif (($name, $args) = $export =~ /^-(\w+)(?:\(([0-9]+|\*|\?)\))?$/) { }
666 0 10 unless $ref ||= $class->can($export)
671 4 3 unless $is_gen
673 3 4 if (not $ref) { }
0 4 elsif ($is_gen) { }
676 2 3 unless $class->can($gen)
680 0 3 unless $ref
683 0 0 unless ref $ref eq 'CODE'
688 0 0 unless ref $ref eq $sigil_to_reftype{$sigil} or ref $ref eq 'REF' and $sigil eq '$'
695 0 1 if ($is_gen and not $ref)
697 0 0 unless $class->can($gen)
701 1 0 ref $ref eq 'ARRAY' ? :
706 0 4 if ($ref) { }
707 0 0 unless ref $ref eq 'CODE' or ref $ref eq 'SCALAR' and $class->can($ref = $$ref)
710 0 4 unless $class->can($name)