Branch Coverage

blib/lib/Class/Prototyped.pm
Criterion Covered Total %
branch 270 386 69.9


line true false branch
31 2 28 if ($symbol eq ':OVERLOAD') { }
5 23 elsif ($symbol eq ':REFLECT') { }
5 18 elsif ($symbol eq ':EZACCESS') { }
0 18 elsif ($symbol eq ':SUPER_FAST') { }
4 14 elsif ($symbol eq ':NEW_MAIN') { }
32 2 0 unless (scalar keys %Class::Prototyped::overloadable_symbols)
68 0 93 if scalar(@_) % 2
77 0 1 if scalar(@_) % 2
86 0 15 if scalar(@_) % 2
95 0 1 if scalar(@_) % 2
110 0 110 if scalar(@_) % 2
118 2 108 if ($isPackage) { }
119 0 2 if (scalar keys %{"${package}::";})
148 16 73 $isClone ? :
89 21 scalar @_ || $isClone ? :
152 94 16 if ($isNew)
153 6 88 ref $class && substr(ref $class, 0, 5) ne 'PKG0x' ? :
158 38 56 if (not grep({$$_[0] eq 'class*';} @$parsedSlots) and $classstar ne 'Class::Prototyped')
164 96 14 if scalar @$parsedSlots
184 108 1 if (substr($package, 0, 5) eq 'PKG0x' and $package ne 'Class::Prototyped')
190 0 108 unless my $tied = tied %$self
200 0 91 unless scalar keys %{"${parentPackage}::";}
217 61 172 if exists $isa_cache{$pkg}
219 26 146 if (defined $code and $code != \&DESTROY)
229 26 82 if defined $parent_DESTROY
271 18 2 if $_[0]{'dont_lie'} = $caller eq $i
276 2 18 unless ($_[0]{'dont_lie'})
290 0 0 unless exists $_[0]{'slots'}{$_[1]}
291 0 0 unless UNIVERSAL::isa($_[0]{'slots'}{$_[1]}, 'CODE')
295 0 0 if $dont_lie = $caller eq $i
297 0 0 $dont_lie ? :
306 2 137 unless @_ > 1
320 1 9 unless exists $$slots{$_[1]}
325 1 8 if UNIVERSAL::isa($$slots{$_[1]}, 'CODE')
329 0 8 if substr($_[1], -1) eq '*'
339 5 278 unless exists $$slots{$_[1]}
344 127 151 if (UNIVERSAL::isa($$slots{$_[1]}, 'CODE'))
348 126 1 if $dont_lie = $caller eq $i
351 1 126 unless $dont_lie
370 0 3 if substr($_[1], -1) eq '*'
374 1 2 if (exists $$slots{$_[1]}) { }
375 0 1 if UNIVERSAL::isa($$slots{$_[1]}, 'CODE')
383 0 1 @_ > 1 ? :
392 0 3 unless exists $$slots{$_[1]}
403 1 8 if (exists $$slots{$_[1]} and UNIVERSAL::isa($$slots{$_[1]}, 'CODE'))
409 0 1 if $dont_lie = $caller eq $i
412 1 0 unless $dont_lie
426 0 0 if (UNIVERSAL::isa($$slots{$_[1]}, 'CODE') and (caller 0)[0] ne 'Data::Dumper')
446 0 0 unless defined $elem
469 914 37 if (ref $entity)
470 909 5 if (substr(ref $entity, 0, 5) eq 'PKG0x') { }
3 2 elsif ($Class::Prototyped::Mirror::objects{ref $entity} == $entity) { }
484 27 10 unless ($object = $Class::Prototyped::Mirror::objects{$entity})
487 13 14 if ($entity eq 'Class::Prototyped') { }
493 2 12 if $@
500 13 14 if ($entity eq 'Class::Prototyped') { }
506 2 12 if $@
565 2 130 if ($_[0]) { }
571 0 2 if ($package eq $_[0] and scalar keys %{"${package}::";} == 0)
573 0 0 if $@
588 1 3 if scalar @_
592 0 4 defined $$defaults{'FIELD'} ? :
593 1 3 defined $$defaults{'METHOD'} ? :
594 0 4 defined $$defaults{'PARENT'} ? :
604 0 0 unless $$tied{'vivified_parents'}
610 0 105 unless $$tied{'vivified_methods'}
616 0 0 unless $$tied{'vivified_parents'}
617 0 0 unless $$tied{'vivified_methods'}
623 0 53 unless $$tied{'vivified_parents'}
624 0 53 unless $$tied{'vivified_methods'}
642 0 0 @_ > 1 ? :
647 1 0 @_ > 1 ? :
654 6 1058 unless $$tied{'vivified_parents'}
655 6 1058 unless $$tied{'vivified_methods'}
673 69 6 if $$tied{'vivified_parents'}
681 0 6 if (scalar grep({UNIVERSAL::isa($_, 'Class::Prototyped');} @$isa) and $$isa[-1] ne 'Class::Prototyped')
690 0 6 if (@{$parentOrder;})
695 1 5 if scalar @isa and $isa[-1] eq 'Class::Prototyped'
711 69 7 if $$tied{'vivified_methods'}
721 68 356 unless my $code = *{"${package}::$slot";}{'CODE'}
722 1 355 if ref($code) =~ /^Class::Prototyped::FieldAccessor/
723 0 355 if $slot eq 'self*'
725 1 354 if (exists $$slots{$slot}) { }
726 0 1 if not UNIVERSAL::isa($$slots{$slot}, 'CODE') or $$slots{$slot} != $code
749 0 0 unless scalar keys %Data::Dumper::
926 0 219 if scalar(@_) % 2
938 163 248 if (ref $slotThing eq 'ARRAY') { }
942 123 40 if ($temp eq 'METHOD' or $temp eq 'FIELD' or $temp eq 'PARENT') { }
947 14 16 substr($slotName, -1) eq '*' ? :
10 30 $isCode ? :
952 79 84 if ($#{$slotThing;} >= $temp) { }
0 84 elsif (defined $$defaults{$slotType}) { }
953 31 48 if ($#{$slotThing;} == $temp) { }
955 0 31 defined $$defaults{$slotType} ? :
961 0 48 defined $$defaults{$slotType} ? :
968 67 96 if ($slotType eq 'METHOD') { }
34 62 elsif ($slotType eq 'PARENT') { }
969 0 67 if substr($slotName, -1) eq '!'
972 1 66 unless $isCode
976 0 34 if substr($slotName, -2, 1) eq '*'
982 65 77 substr($slotName, -1) eq '*' ? :
106 142 $isCode ? :
985 1 247 if (defined $$defaults{$slotType})
990 35 213 if ($slotType eq 'METHOD' and substr($slotName, -1) eq '!')
996 0 248 if ($slotType eq 'FIELD' and substr($slotName, -1) eq '&')
1003 4 244 if ($slotType eq 'PARENT' and substr($slotName, -2) eq '**')
1009 0 410 if ($slotType eq 'METHOD' and exists $Class::Prototyped::overloadable_symbols{$slotName}) { }
1013 0 410 if $$slotAttribs{'overload'} and not exists $Class::Prototyped::overloadable_symbols{$slotName}
1017 3 407 if (substr($slotName, -1) eq '*') != ($slotType eq 'PARENT') and not $$slotAttribs{'overload'}
1020 10 397 if ($slotName eq '*')
1024 119 288 if (scalar keys %{$slotAttribs;})
1028 6 115 unless exists $$attributes{$attrib}
1032 77 38 if ($atype eq 'filter') { }
22 16 elsif ($atype eq 'advisory') { }
16 0 elsif ($atype eq 'implementor') { }
1039 0 16 if defined $slotImplementor
1041 16 0 if $$slotAttribs{$attrib}
1048 76 37 if (defined $slotFilters)
1049 0 1 unless $$attributes{$a}{'rank'} <=> $$attributes{$b}{'rank'}
1054 22 91 if (defined $slotAdvisories)
1059 0 401 if $slotName eq 'self*'
1061 0 401 if exists $Class::Prototyped::overloadable_symbols{$slotName} and $slotType ne 'METHOD'
1065 96 305 if ($slotType eq 'PARENT') { }
169 136 elsif ($slotType eq 'METHOD') { }
1066 0 96 if $isCode
1068 0 2 unless (UNIVERSAL::isa($slotValue, 'Class::Prototyped') or ref \$slotValue eq 'SCALAR' and defined $slotValue)
1076 0 96 if (UNIVERSAL::isa($slotValue, $package))
1082 0 169 if $slotName eq 'DESTROY' and substr($package, 0, 5) eq 'PKG0x'
1100 16 385 if exists $$slots{$slotName}
1104 96 305 if ($slotType eq 'PARENT') { }
1107 58 38 if (substr($parentPackage, 0, 5) eq 'PKG0x') { }
1111 0 38 if $parentPackage =~ /\.p[lm]$/i
1117 0 38 unless (ref $slotValue or scalar keys %{"${parentPackage}::";})
1124 16 80 $$slotAttribs{'promote'} ? :
1141 22 110 @_ > 1 ? :
1142 169 120 $slotType eq 'METHOD' ? :
16 289 defined $slotImplementor ? :
1145 76 229 if (defined $slotFilters)
1151 4 301 if (defined $slotAdvisories)
1157 0 305 if ($$slotAttribs{'overload'}) { }
1161 0 0 if $@
1195 0 390 if substr($slot, -2) eq '**'
1196 0 390 if substr($slot, -1) eq '!'
1198 0 390 unless exists $$slots{$slot}
1202 94 296 if (substr($slot, -1) eq '*') { }
1207 94 0 if ($index < @$parentOrder) { }
1219 0 0 unless ($Class::Prototyped::Mirror::ending)
1225 94 0 if (defined $value) { }
1227 58 36 if (substr($parentPackage, 0, 5) eq 'PKG0x')
1235 0 0 unless ($Class::Prototyped::Mirror::ending)
1243 0 296 if (exists $Class::Prototyped::overloadable_symbols{$slot}) { }
1247 0 0 if 1 == grep({exists $Class::Prototyped::overloadable_symbols{$_};} keys %$slots)
1254 0 0 if $@
1269 1184 296 unless defined $elem
1287 14 90 if (caller 1)[0] eq 'Class::Prototyped::Mirror::SUPER'
1289 90 0 if (caller 2)[0] eq 'Class::Prototyped::Mirror::SUPER'
1302 0 104 unless $message
1315 104 0 if $method
1318 0 104 unless $method
1330 152 58 if ($type)
1333 210 0 wantarray ? :
1341 0 3 unless exists $$types{$slotName}
1357 4 0 wantarray ? :
1374 0 12 if $$seen{$parent}++
1379 12 12 wantarray ? :
1404 183 0 $slot ne 'self*' ? :
1406 33 150 unless wantarray
1408 1 149 unless $$attribs{$slot}
1410 0 150 if (not defined $format or $format eq 'default') { }
2 148 elsif ($format eq 'simple') { }
148 0 elsif ($format eq 'rotated') { }
1432 24 22 if (defined $type or defined $format) { }
1438 2 100 unless $$attribs{$_}
1443 46 0 wantarray ? :
1456 0 0 if ($seen{$slot} > 1 or not exists $$slots{$slot}) { }
1466 0 0 ref $$slots{$_} ? :
1494 0 2 unless my $wrapped = $mirror->getSlot('wrapped*')
1508 0 10 UNIVERSAL::isa($name, 'ARRAY') ? :
1515 1 9 if @conflicts
1521 5 4 if (UNIVERSAL::isa($value, 'ARRAY'))
1526 1 8 if UNIVERSAL::isa($delegate, 'CODE')
1530 5 3 defined $delegateMethod ? :
1546 0 22 unless UNIVERSAL::can($object, $slotName)
1549 7 7 wantarray ? :
14 8 if exists $$slots{$slotName}
1555 4 4 if (wantarray) { }
1557 4 0 if scalar @retval
1561 4 0 if $retval
1583 1 0 if $name =~ /\.p[lm]$/i
1588 1 0 if defined $accessorName
1594 0 1 if $@
1597 1 0 if (substr($name, -1) eq q['])
1602 1 0 if defined $accessorName