Branch Coverage

blib/lib/Mite/Attribute.pm
Criterion Covered Total %
branch 171 286 59.7


line true false branch
41 2 24 unless $_[0]->class
179 122 5 if defined $self->compiling_class
182 0 5 if $shim
183 0 5 $function eq 'carp' ? :
217 0 161 if $self->required and not defined $self->init_arg
220 4 157 if ($self->is eq "lazy")
222 1 3 unless $self->has_builder or $self->has_default
226 0 161 if ($self->has_builder and $self->has_default)
231 7 315 if (&CodeRef()->check($self->$method_type))
238 39 1410 if (defined $name and $name eq Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.26.1/B/Deparse.pm line 5018.
246 5 156 if (defined $self->lvalue)
247 1 4 if $self->lazy
249 1 3 if $self->trigger
251 1 2 if $self->weak_ref
253 1 1 if $self->type or $self->coerce
255 0 1 if $self->cloner_method
263 14 584 unless defined $name
264 459 125 unless $name =~ /\%/
278 0 8 if (exists $args{'is'})
285 0 8 if $args{'isa'} or $args{'type'}
293 5 3 if (exists $args{'builder'} or exists $args{'default'})
307 53 97 $self->is eq 'ro' || $self->is eq 'rwp' ? :
312 3 146 $self->is eq 'rwp' ? :
317 56 93 $self->is eq 'rw' ? :
330 118 2 unless @{$self->alias;}
331 1 1 $self->is eq 'rw' ? :
335 2 0 if $self->$sought
343 254 6 unless @$aliases
358 1 0 if (ref $self->handles) { }
0 0 elsif ($self->handles) { }
359 1 0 unless ($self->handles_via)
376 17 104 if (my $isa = $self->_isa) { }
0 104 elsif (my $does = $self->_does) { }
2 102 elsif ($self->has_enum) { }
393 2 15 if (ref $string) { }
396 0 2 if (&blessed($type) and not $type->isa('Type::Tiny')) { }
1 1 elsif (not &blessed($type)) { }
397 0 0 if ($type->can('to_TypeTiny')) { }
418 0 15 unless $type
421 0 17 unless $type->can_be_inlined
424 6 11 if ($self->coerce)
425 0 6 unless $type->has_coercion
427 0 6 unless $type->coercion->can_be_inlined
438 2 0 if ($self->has_enum)
441 0 2 if (not $values and my $type = $self->type)
446 0 0 if ($enum)
465 0 80 unless $self->has_default
474 0 39 unless $self->has_default
483 0 38 unless $self->has_default
491 0 82 unless $self->has_default
500 0 0 $self->imported_functions->{'true'} ? :
0 43 unless my $type = $self->type
504 0 43 if ($self->compiling_class and $self->compiling_class->imported_functions->{'blessed'})
508 0 0 if ($ctype == &Object()) { }
0 0 elsif ($ctype->isa('Type::Tiny::Class')) { }
522 0 43 if (my $autolax = $self->autolax)
531 15 0 if ($self->coerce and my $type = $self->type)
543 1 19 if $self->default_is_trusted
544 12 7 unless my $type = $self->type
546 3 4 if ($self->coerce)
557 13 68 if ($self->has_builder) { }
29 39 elsif ($self->has_coderef_default) { }
1 38 elsif ($self->has_inline_default) { }
3 35 elsif ($self->has_reference_default) { }
0 35 elsif ($self->has_simple_default and $self->type and $self->type == &Bool()) { }
35 0 elsif ($self->has_simple_default) { }
568 1 2 &HashRef()->check($self->default) ? :
571 0 0 $self->compiling_class->imported_functions->{'true'} ? :
572 0 0 $self->compiling_class->imported_functions->{'false'} ? :
573 0 0 $self->default ? :
576 34 1 defined $self->default ? :
594 2 10 if ("CODE" eq ref $self->cloner_method)
599 2 8 if (&MethodNameTemplate()->check($self->cloner_method))
608 2 0 $1 eq '_' ? :
619 127 3 if (defined $init_arg) { }
0 5 elsif ($self->has_default || $self->has_builder and not $self->lazy) { }
621 2 125 if (my(@alias) = $self->_all_aliases)
634 5 122 if ($self->clone_on_write)
639 61 66 if ($self->has_default || $self->has_builder and not $self->lazy) { }
6 60 elsif ($self->required and not $self->lazy) { }
640 1 60 if ($self->default_is_trusted and my $type = $self->type) { }
5 55 elsif ($self->type) { }
643 1 0 if ($type->has_coercion) { }
668 1 60 $self->default_does_trigger && !$self->lazy && ($self->has_default || $self->has_builder) ? :
672 2 59 $self->trigger ? :
685 3 57 $self->trigger ? :
697 17 110 if ($needs_check and my $type = $self->type) { }
698 5 12 if ($self->coerce)
726 1 129 if ($self->weak_ref)
732 62 81 unless /;\s*$/
741 106 5 if (my $class = $self->compiling_class)
744 5 0 unless $self->class
745 0 0 unless eval {
912 1 1 if ($self->handles eq 1) { }
1 0 elsif ($self->handles eq 2) { }
919 2 0 if (defined $prefix)
922 0 2 if ($self->lazy or $self->clone_on_read) { }
938 0 2 if ($needs_reader)
972 7 1 if (defined $reader_method) { }
981 0 0 if (defined $writer_method) { }
999 3 0 if ($gen->coerce and $type->{'uniq'} == &Bool()->{'uniq'})
1002 0 0 if ($gen->coerce and $type->has_coercion)
1019 0 2 unless my(%handles) = %{$self->handles;}
1032 1 4 if (keys %{$$result{'environment'};}) { }
1055 112 8 unless $self->has_handles
1060 2 6 if ($self->has_handles_via) { }
4 2 elsif (ref $self->handles) { }
1103 840 120 $self->can($method_type) ? :
1104 829 131 unless defined $method_name
1107 126 5 if ($xs_option_name{$method_type})
1113 4 4 if ($self->has_handles and not $self->has_handles_via and ref $self->handles)
1119 10 91 if ($self->type or $self->weak_ref or $self->trigger or $self->clone_on_write)
1125 21 99 if ($self->lazy or $self->clone_on_read)
1131 112 8 if (keys %want_xs or keys %want_pp)
1136 79 41 if (keys %want_xs)
1162 2 118 if ($self->alias and my $alias_is_for = $self->alias_is_for)
1193 0 221 unless $context{'context'} and $context{'file'} and $context{'line'}
1206 0 0 if ($self->compiling_class->isa('Mite::Class')) { }
1220 0 0 $self->weak_ref ? :
1224 0 0 if (defined $init_arg) { }
1226 0 0 $self->required ? :
1233 0 0 if (my $type = $self->type)
1235 0 0 if ($type->name and $type->library) { }
0 0 elsif ($type->isa('Type::Tiny::Union') and &List::Util::all(sub {
0 0 elsif ($type->is_parameterized and 1 == @{$type->parameters;} and $type->parent->name and $type->parent->library and $type->type_parameter->name and $type->type_parameter->library) { }
1238 0 0 if $_->name
1262 0 0 if ($type->has_coercion)
1273 0 0 if ($type->has_coercion and $self->coerce)
1280 0 0 unless defined $name
1304 0 0 unless defined $name
1320 0 0 if ($self->has_handles_via) { }
0 0 elsif (ref $self->handles) { }
0 0 elsif ($self->has_handles) { }
1365 0 0 if ($hstring)
1407 0 0 if (my $builder = $self->_expand_name($self->builder)) { }
0 0 elsif ($self->has_inline_default or $self->has_reference_default) { }
0 0 elsif ($self->has_coderef_default) { }
0 0 elsif ($self->has_default) { }
1419 0 0 if ($self->has_default or $self->has_builder)
1420 0 0 $self->lazy ? :
1423 0 0 if (my $trigger = $self->_expand_name($self->trigger))
1427 0 0 if ($self->has_documentation)
1431 0 0 unless ($self->compiling_class->isa("Mite::Class"))