Branch Coverage

blib/lib/Rose/HTML/Object.pm
Criterion Covered Total %
branch 128 164 78.0


line true false branch
248 16 1614 $class eq $class->generic_object_class ? :
271 12 1708 if @_ % 2
294 1055 805 $children && @$children ? :
297 0 0 (shift())->parent ? :
303 464 513 if (@_)
311 1 463 if ($old_parent and &Scalar::Util::refaddr($old_parent) != &Scalar::Util::refaddr($new_parent))
314 1 0 unless $new_parent->has_child($self)
327 2 1 if ($_[0] =~ /^[+-]?\d+$/)
338 1 0 if (&Scalar::Util::refaddr($child) == $refaddr)
357 0 0 if (&Scalar::Util::refaddr($child) == $refaddr)
374 61 1306 unless ($Loaded{$type_class})
377 10 51 unless (@{$type_class . "::ISA";})
388 0 10 if $error
416 0 13 unless @_
426 427 0 if (@_ == 2)
428 36 391 exists $self->{'html_attrs'}{$attr} ? :
438 44 0 if (@_)
456 2 0 if (@_)
474 5 27135 unless not $self->validate_html_attrs or $self->html_attr_is_valid($attr)
480 12099 15036 if (@_ == 3) { }
15036 0 elsif (@_ == 2) { }
482 1 12098 if ($hook)
492 13854 1182 if (exists $self->{'html_attrs'}{$attr})
496 1 13853 if ($hook)
514 1 56130 if $attr =~ /^data-\w/
521 4 1 wantarray ? :
528 2 0 if (@_)
532 1 1 if (@_ == 1 and ref $_[0] eq 'HASH') { }
538 0 1 if @_ % 2
548 0 2 wantarray ? :
555 0 27137 unless not $self->validate_html_attrs or $self->html_attr_is_valid($attr)
559 2 27135 if (@_)
565 4 27131 if (exists $self->{'html_attr_hook'}{$attr})
582 0 90 if (my $code = $self->html_error_formatter)
589 17 73 if ($error and length "$error")
591 13 4 $self->escape_html ? :
603 0 36 if (my $code = $self->html_error_formatter)
615 0 4 if (my $code = $self->html_error_formatter)
622 4 0 if ($error)
624 4 0 $self->escape_html ? :
636 0 2 if (my $code = $self->html_error_formatter)
659 3607 18 if (exists $self->{'html_attrs'}{$attr})
664 3383 242 if (defined $value or exists $boolean_attrs{$attr}) { }
58 184 elsif (exists $required_attrs->{$attr}) { }
666 726 2657 if ($boolean_attrs{$attr})
668 133 593 if $value
672 0 2657 unless defined $value
673 249 2408 $value =~ /\W/ ? :
679 28 30 unless defined $value
680 0 58 $value =~ /\W/ ? :
685 385 1109 unless @html
708 1898 10 if (exists $self->{'html_attrs'}{$attr})
713 1800 108 if (defined $value or exists $boolean_attrs{$attr}) { }
41 67 elsif (exists $required_attrs->{$attr}) { }
715 308 1492 if ($boolean_attrs{$attr})
717 0 49 $attr =~ /\W/ ? :
49 259 if $value
721 0 1492 unless defined $value
722 133 1359 $value =~ /\W/ ? :
728 15 26 unless defined $value
729 0 41 $value =~ /\W/ ? :
734 21 525 unless @html
748 870 491 if ($self->has_children or not $self->is_self_closing)
764 196 301 if ($self->has_children or not $self->is_self_closing)
781 14 17 unless ($class =~ /(?:^| )$new_class(?: |$)/)
783 6 8 $class ? :
792 1 1 ref $_[0] eq ref [] ? :
805 16 796 if ($class =~ s/(^| |\G)\Q$delete_class\E( |$)/$1$2/g)
823 2 1 ref $_[0] eq ref [] ? :
882 9 0 if (@_)
910 8101 1749 if $code
912 1749 0 unless $self->html_attr_is_valid($name) and $class->autoload_html_attr_methods
920 0 0 if $code
940 1 0 @_ ? :
944 0 2 if defined &$method
958 3 0 if ($arg eq ':customize') { }
1014 3 43 ref $_[0] && ref $_[0] eq 'HASH' ? :
1037 0 210 if (ref $arg eq 'HASH') { }
1052 210 12 if (defined &{$class . "::" . $method;})
1070 138 0 if (my $class = ref $self) { }
1075 135 3 if ($class->html_attr_is_valid($name) and $class->autoload_html_attr_methods)
1084 1 2 $class->html_attr_is_valid($name) ? :