Condition Coverage

lib/HTML/Object/EventTarget.pm
Criterion Covered Total %
condition 49 122 40.1


and 3 conditions

line !l l&&!r l&&r condition
53 5 0 0 not ref $callback and $callback =~ /$HTML::Object::EventTarget::PACK_SUB_RE/
72 5 0 0 exists $opts->{'post_processing'} and ref $opts->{'post_processing'} eq "CODE"
91 5 0 0 $params->{'signal'} and $params->{'signal'} =~ /^\w+$/
125 0 2 0 $can_cancel and $event->cancelled
137 0 6 0 $can_cancel and $event->cancelled
144 0 2 0 $can_cancel and $event->cancelled >= $event->CANCEL_IMMEDIATE_PROPAGATION
148 0 2 0 $can_cancel and $event->cancelled >= $event->CANCEL_PROPAGATION
162 0 4 0 $can_cancel and $event->cancelled
178 0 0 138 defined $type and length $type
188 0 0 3 exists $repo->{$type}{$key} and $self->_is_a($repo->{$type}{$key}, "HTML::Object::EventListener")
231 0 0 8 defined $key and length $key
252 6 2 0 $eventPhase eq $evt->AT_TARGET and $evt->target ne $self
4 1 3 $eventPhase eq $evt->CAPTURING_PHASE and not $listener->capture
3 1 1 $eventPhase eq $evt->BUBBLING_PHASE and $listener->capture
272 0 4 0 $can_cancel and $evt->cancelled == $evt->CANCEL_IMMEDIATE_PROPAGATION
284 2 0 0 defined $type and length $type
309 0 0 138 defined $event and length $event
317 0 0 1 defined $event and length $event
344 2 0 0 not ref $callback and $callback =~ /$HTML::Object::EventTarget::PACK_SUB_RE/
358 0 2 0 defined $callback and ref $callback ne "CODE"
360 2 0 0 defined $eh and not exists $opts->{'capture'}
411 0 0 0 exists $opts->{'callback'} and ref $opts->{'callback'} eq "CODE"

or 2 conditions

line l !l condition
49 5 0 shift @_ || (return $self->error('No event listener type was provided.'))
50 5 0 shift @_ || (return $self->error('No event listener callback was provided.'))
77 4 1 $params->{'capture'} //= 0
78 0 5 $params->{'once'} //= 0
79 0 5 $params->{'passive'} //= 0
83 0 5 delete $params->{'debug'} || 0
84 5 0 'HTML::Object::EventListener'->new('type', $type, 'code', $callback, 'options', $params, 'element', $self, 'debug', $debug) || (return $self->pass_error('HTML::Object::EventListener'->error))
118 2 0 shift @_ || (return $self->error('No event object was provided.'))
122 2 0 $event->type || (return $self->error('The event has no type associated with it!'))
196 12 0 shift @_ || (return $self->error({'message', 'No event was provided to handle.', 'class', 'HTML::Object::SyntaxError'}))
208 12 0 $evt->type || (return $self->error({'message', 'No event type was provided.', 'class', 'HTML::Object::SyntaxError'}))
310 3 135 $self->getEventListeners($event) || (return)
323 1 0 $self->addEventListener($event, $arg) || (return $self->pass_error)
332 2 0 shift @_ || (return $self->error('No event listener type was provided.'))
341 2 0 shift @_ || (return $self->error('No event listener callback was provided.'))
371 2 0 $params->{'capture'} //= 0
407 0 0 $opts->{'class'} //= ""
408 0 0 $opts->{'class'} || 'HTML::Object::Event'
410 0 0 $class->new($type, @_) || (return $self->error($class->error))

or 3 conditions

line l !l&&r !l&&!r condition
56 0 0 0 $pack ||= caller
252 0 3 5 $eventPhase eq $evt->AT_TARGET and $evt->target ne $self or $eventPhase eq $evt->CAPTURING_PHASE and not $listener->capture
3 3 2 $eventPhase eq $evt->AT_TARGET and $evt->target ne $self or $eventPhase eq $evt->CAPTURING_PHASE and not $listener->capture or $eventPhase eq $evt->BUBBLING_PHASE and $listener->capture
348 0 0 0 $pack ||= caller
386 0 0 0 shift @_ || do {
408 0 0 0 $class //= $opts->{'class'} || 'HTML::Object::Event'