Condition Coverage

lib/HTML/Object/Element.pm
Criterion Covered Total %
condition 70 336 20.8


and 2 conditions

line l !l condition
357 0 3 not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
360 0 0 not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
1239 16142 2121 not length $self->{'_reset'} and scalar @_
1526 0 0 not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
1529 0 0 not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL

and 3 conditions

line !l l&&!r l&&r condition
81 101 1217 4 not $opts->{'is_empty'} and exists $attr->{'/'}
112 0 0 0 $path->length and $offset = $path->shift
156 72 26 11 $self->{'_cache_value'} and not length $self->{'_reset'}
162 36 14 48 $self->original->defined and $hash1 eq $hash2
191 12 2 41 $self->original->defined and $hash1 eq $hash2
212 11 44 0 $parent and defined(my $pos = $parent->children->pos($close))
229 24 12 6 $self->original->defined and $hash1 eq $hash2
237 1 29 4 $parent and defined(my $pos = $parent->children->pos($close))
254 8 3 1 $self->{'_cache_text'} and not length $self->{'_reset'}
271 18 0 0 exists $opts->{'callback'} and ref $opts->{'callback'} eq "CODE"
350 58 0 3 exists $callbacks->{$attr} and ref $callbacks->{$attr} eq "CODE"
353 3 0 0 $INC{'threads.pm'} and not exists $INC{'forks.pm'}
357 3 0 0 defined $Nice::Try::WANT and length $Nice::Try::WANT
360 0 0 0 defined $Nice::Try::WANT and length $Nice::Try::WANT
3 0 0 defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')
0 0 0 defined $Nice::Try::WANT and length $Nice::Try::WANT
0 0 0 defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
0 0 0 defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
0 0 0 defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
0 0 0 defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
2 1 0 scalar @Nice::Try::VOID and !&Scalar::Util::blessed($Nice::Try::VOID[0]) || &Scalar::Util::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')
627 0 0 0 defined $def and !$has_expectation || $has_expectation && !exists($$wants{"$tag"})
636 0 0 0 $e->attributes->exists($attr) and length($val = $e->attributes->get($attr))
671 0 0 0 $self->attributes->exists($att) and $self->attributes->get($att) eq $val
680 0 0 0 $e->attributes->exists($att) and $e->attributes->get($att) eq $val
857 0 0 0 ref $this->{'val'} and ref $this->{'val'} ne ref $val
0 0 0 !ref($val) || overload::Method($val . '""') and lc "$val" ne lc "$this->{'val'}"
884 107 0 0 exists $opts->{'max_match'} and $a->length >= $opts->{'max_match'}
886 99 1 7 exists $opts->{'max_level'} and $def->{'level'} + 1 > $opts->{'max_level'}
1000 0 0 0 $self->_is_object($this) and $this->isa("HTML::Object::Element")
1024 0 0 0 $self->_is_object($this) and !overload::Overloaded($this) || overload::Overloaded($this) && !overload::Method($this, '""')
1026 0 0 0 not defined $elem and "$this" =~ /^\w+$/
1082 0 0 0 scalar @_ == 1 and ref $_[0] eq "HASH"
1106 0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Text")
0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Text") and defined $prev
0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Text") and defined $prev and $self->_is_a($prev, "HTML::Object::Text")
0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Space")
0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Space") and defined $prev
0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Space") and defined $prev and $self->_is_a($prev, "HTML::Object::Space")
1399 0 0 0 ref $rank and not $self->_is_a($rank, "Module::Generic::Number")
1430 0 0 0 defined $parent_addr and $addr eq $parent_addr
1431 0 0 0 $_->isa("HTML::Object::Text") and defined $prev
0 0 0 $_->isa("HTML::Object::Text") and defined $prev and $prev->isa("HTML::Object::Text")
0 0 0 $_->isa("HTML::Object::Space") and defined $prev
0 0 0 $_->isa("HTML::Object::Space") and defined $prev and $prev->isa("HTML::Object::Space")
1462 0 0 0 defined $prev and $self->_is_a($prev, "HTML::Object::Text")
1483 5 0 0 ref $this and !$self->_is_object($this) || $self->_is_object($this) && !overload::Method($this, '""')
1501 4 0 0 defined $prev and $self->_is_a($prev, "HTML::Object::Text")
1521 0 101 1038 defined $data and length "$data"
1522 1038 0 0 $INC{'threads.pm'} and not exists $INC{'forks.pm'}
1526 1038 0 0 defined $Nice::Try::WANT and length $Nice::Try::WANT
1529 0 0 0 defined $Nice::Try::WANT and length $Nice::Try::WANT
0 0 1038 defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')
1038 0 0 defined $Nice::Try::WANT and length $Nice::Try::WANT
0 0 0 defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
0 0 0 defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
0 0 0 defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
0 0 0 defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
0 0 0 scalar @Nice::Try::VOID and !&Scalar::Util::blessed($Nice::Try::VOID[0]) || &Scalar::Util::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')
1550 0 0 8 defined $id && length $id
1574 0 215 0 defined $this and not $self->_is_a($this, "HTML::Object::Element")

or 2 conditions

line l !l condition
122 0 0 $self->pos || 0
154 109 0 $opts->{'inside_collection'} //= 0
155 47 62 $opts->{'recursive'} //= 0
305 0 0 $self->as_text($opts) || (return)
324 339 0 shift @_ || (return $self->error('No attribute name provided.'))
441 46 0 $self->new_closing({'attributes', $opts->{'attr'}, 'attributes_sequence', $opts->{'seq'}, 'column', $opts->{'col'}, 'line', $opts->{'line'}, 'offset', $opts->{'offset'}, 'original', $opts->{'raw'}, 'tag', $self->tag, 'debug', $self->debug}) || (return $self->pass_error)
568 0 0 shift @_ || 0
725 0 0 shift @_ || (return $self->error('No html element was provided to insert.'))
950 0 0 'HTML::Object::Attribute'->new(@_) || (return $self->pass_error('HTML::Object::Attribute'->error))
959 0 0 'HTML::Object::Closing'->new(@_) || (return $self->pass_error('HTML::Object::Closing'->error))
968 0 0 'HTML::Object::Document'->new('debug', $self->debug) || (return $self->pass_error('HTML::Object::Document'->error))
976 0 0 shift @_ || (return $self->error('No tag was provided to create an element.'))
977 0 0 'HTML::Object'->get_definition($tag) || (return $self->pass_error('HTML::Object'->error))
981 0 0 'HTML::Object::Element'->new({'is_empty', $dict->{'is_empty'}, 'tag', $dict->{'tag'}, 'debug', $self->debug}) || (return $self->pass_error('HTML::Object::Element'->error))
1002 0 0 &$crawl($this, $elem // $parent) || (return)
1028 0 0 $self->new_element("$this") || (return)
1040 0 0 $self->new_text("$this") || (return)
1056 0 0 $self->new_document || (return)
1062 0 0 &$crawl($this) || (return)
1073 0 0 'HTML::Object'->new('debug', $self->debug) || (return $self->pass_error('HTML::Object'->error))
1092 0 0 'HTML::Object::Text'->new($p) || (return $self->pass_error('HTML::Object::Text'->error))
1152 0 0 $self->_get_elements_list(@_) || (return $self->pass_error)
1171 0 0 $self->_get_elements_list(@_) || (return $self->pass_error)
1188 0 0 $self->_get_elements_list(@_) || (return $self->pass_error)
1207 0 0 $self->_get_elements_list(@_) || (return $self->pass_error)
1283 0 0 shift @_ || (return $self->error('No element object was provided to compare against.'))
1326 0 0 $self->_get_elements_list(@_) || (return $self->pass_error)
1343 0 0 shift @_ || (return $self->error('No code provided to traverse the html tree.'))
1346 0 0 $opts->{'bottom_up'} //= 0
1373 0 0 $self->_get_elements_list(@_) || (return $self->pass_error)
1494 1 0 $p->parse_data("$this") || (return $self->error('Error while parsing html data provided: ', $p->error))

or 3 conditions

line l !l&&r !l&&!r condition
268 16 2 1 $e->isa("HTML::Object::Text") or $e->isa("HTML::Object::Space")
279 16 2 1 $e->isa("HTML::Object::Text") or $e->isa("HTML::Object::Space")
286 0 0 11 $self->isa("HTML::Object::Text") or $self->isa("HTML::Object::Space")
360 0 0 3 defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return'
0 0 0 !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')
0 0 0 not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
0 0 1 !&Scalar::Util::blessed($Nice::Try::VOID[0]) || &Scalar::Util::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')
591 0 0 0 not $e->is_empty or $e->children->length
627 0 0 0 !$has_expectation || $has_expectation && !exists($$wants{"$tag"})
753 4 0 118 not defined $pos or $offset > $pos
857 0 0 0 !ref($val) || overload::Method($val . '""')
0 0 0 ref $this->{'val'} and ref $this->{'val'} ne ref $val or !ref($val) || overload::Method($val . '""') and lc "$val" ne lc "$this->{'val'}"
1003 0 0 0 defined $elem or defined $parent
1005 0 0 0 $elem // $parent
1006 0 0 0 $elem // $parent
1016 0 0 0 $elem // $parent
1024 0 0 0 !overload::Overloaded($this) || overload::Overloaded($this) && !overload::Method($this, '""')
1038 0 0 0 $elem // $parent
1106 0 0 0 defined $_ and $self->_is_a($_, "HTML::Object::Text") and defined $prev and $self->_is_a($prev, "HTML::Object::Text") or defined $_ and $self->_is_a($_, "HTML::Object::Space") and defined $prev and $self->_is_a($prev, "HTML::Object::Space")
1259 0 0 106 not defined $pos or $offset < $pos
1431 0 0 0 $_->isa("HTML::Object::Text") and defined $prev and $prev->isa("HTML::Object::Text") or $_->isa("HTML::Object::Space") and defined $prev and $prev->isa("HTML::Object::Space")
1483 0 0 0 !$self->_is_object($this) || $self->_is_object($this) && !overload::Method($this, '""')
1529 1038 0 0 defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return'
1038 0 0 !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')
0 1038 0 not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
0 0 0 !&Scalar::Util::blessed($Nice::Try::VOID[0]) || &Scalar::Util::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')
1574 0 0 215 not defined $this or defined $this and not $self->_is_a($this, "HTML::Object::Element")