Branch Coverage

blib/lib/Moos.pm
Criterion Covered Total %
branch 105 170 61.7


line true false branch
34 2 14 if ($_[1] || '') eq -'Role'
46 0 14 exists $args{'base_class'} ? :
49 14 0 if defined $baseclass
61 0 14 if $ENV{'PERL_MOOS_XXX'}
93 0 2 if $ENV{'PERL_MOOS_XXX'}
104 24 1 unless ref $name
109 6 19 if (@_ % 2)
114 2 3 ref $default eq 'ARRAY' ? :
1 5 ref $default eq 'HASH' ? :
140 44 32 if (defined $meta)
154 0 0 unless eval q[use XXX -with => 'YAML::XS'; 1]
215 190 0 @_ == 1 ? :
232 14 5 if (ref $code) { }
233 0 14 if ($has_subname) { }
260 0 0 unless ($$TRACE_EXCLUDE{"$pkg $name"})
271 15 0 if (@supers)
295 0 1 if (my $class_of = 'Class::MOP'->can('class_of'))
300 0 0 &$class_of($role) ? :
302 0 0 if (ref $roles[0] eq 'HASH')
307 0 0 if (@moose and my $apply = 'Moose::Util'->can('apply_all_roles'))
327 0 0 if $attr->$has
337 1 0 if (@roles)
346 0 2 unless $Role::Tiny::INFO{$role}{'attributes'}
361 12 0 if $object->can('BUILDALL')
370 0 26 if exists $$instance{$name}
371 11 15 if (exists $$params{$name}) { }
14 1 elsif (not $$attr{'lazy'}) { }
375 0 14 if (my $builder = $$attr{'builder'}) { }
10 4 elsif (my $default = $$attr{'default'}) { }
376 0 0 if defined $builder and $builder eq '1'
384 1 13 if ($$attr{'required'} and not exists $$instance{$name})
389 1 24 if (exists $$attr{'trigger'} and exists $$params{$name})
405 1 26 if $attrs{$name}
421 0 0 if $_->name eq $name
434 2 0 @_ == 1 ? :
472 0 190 @_ == 1 ? :
476 0 190 if defined $$args{'builder'} and $$args{'builder'} eq '1'
478 0 6 $name =~ /^_/ ? :
6 184 if defined $$args{'clearer'} and $$args{'clearer'} eq '1'
480 0 1 $name =~ /^_/ ? :
1 189 if defined $$args{'predicate'} and $$args{'predicate'} eq '1'
482 1 189 if defined $$args{'trigger'} and $$args{'trigger'} eq '1'
485 0 2 unless $method ||= $_[0]->can($trigger)
490 21 169 unless defined $$args{'is'}
498 0 190 unless my $metaclass = $$self{'associated_class'}
502 558 198 unless exists $$self{$_}
503 196 2 if $$self{$_} =~ /$VALID_NAME/
504 1 1 $_ eq 'name' ? :
511 177 11 unless ($$self{'_skip_setup'})
513 4 173 if $$self{'clearer'}
514 1 176 if $$self{'predicate'}
515 2 175 if $$self{'handles'}
525 163 14 if ($self->_is_simple)
526 163 0 if ($Moos::CAN_HAZ_XS) { }
527 157 6 $$self{'is'} eq 'ro' ? :
534 0 0 $$self{'is'} eq 'ro' ? :
544 0 0 exists $_[0]{$name} ? :
0 0 $#_ ? :
549 5 1 exists $_[0]{$name} ? :
1 6 $#_ ? :
554 3 0 $#_ ? :
555 11 3 $default ? :
0 14 $builder ? :
557 0 14 if ($$self{'is'} eq 'ro') { }
4 10 elsif (exists $$self{'trigger'}) { }
560 0 0 if @_ > 1
566 0 4 unless ref $$self{'trigger'}
569 4 2 if (@_ > 1)
570 3 1 exists $_[0]{$name} ? :
580 0 14 if $ENV{'PERL_MOOS_ACCESSOR_CALLS'}
593 0 4 unless my $clearer = $$self{'clearer'}
602 0 1 unless my $predicate = $$self{'predicate'}
604 1 0 if ($Moos::CAN_HAZ_XS)
619 0 2 unless exists $$self{'handles'}
622 0 2 if &Scalar::Util::reftype($$self{'handles'}) eq 'HASH'
624 2 0 if &Scalar::Util::reftype($$self{'handles'}) eq 'ARRAY'
629 2 1 if $method =~ /$VALID_NAME/
632 1 0 if ($self->_is_simple) { }
656 1 12 @_ && ref $_[0] eq 'HASH' ? :
661 12 190 unless $_[0]->can('BUILD')
665 190 190 if (defined &{"${package}::BUILD";})
676 0 0 if @_
687 0 0 if $INC{'Role/Tiny.pm'} and Role::Tiny::does_role($self, $role)
690 0 0 if $INC{'Moose/Util.pm'} and 'Moose::Util'->can('does_role') and Moose::Util::does_role($self, $role)
700 0 0 unless $self->does($role)