Branch Coverage

blib/lib/Treex/Core/Node.pm
Criterion Covered Total %
branch 109 212 51.4


line true false branch
64 0 0 unless (defined $arg_ref and defined $arg_ref->{'_called_from_core_'} or $Treex::Core::Config::running_in_tred)
100 261 0 if (defined $document)
125 0 1426 if @_ != 2
128 206 1450 unless (defined $val)
129 0 206 if $attr_name =~ m[[^-\w/.]]
142 0 138 if @_ != 3
143 0 138 if ($attr_name eq 'id') { }
9 129 elsif (ref $attr_value eq 'ARRAY') { }
144 0 0 if (not defined $attr_value or $attr_value eq '')
153 12 126 if ($attr_name =~ /\.rf$/) { }
8 118 elsif ($attr_name eq 'alignment') { }
158 5 7 if ($old_value)
159 2 3 if (ref $old_value eq 'Treex::PML::List' and @$old_value) { }
168 3 9 ref $attr_value eq 'Treex::PML::List' ? :
173 4 4 if ($self->{'alignment'})
177 8 0 if ($attr_value and @$attr_value)
186 0 138 if ($LOG_EDITS)
188 0 0 if ($signature) { }
196 130 8 if $attr_name =~ /^[\w\.]+$/ or $attr_name eq '#name'
197 0 8 if $attr_name =~ m[[^-\w/.]]
205 8 8 if (@steps) { }
206 4 4 unless (defined $val->{$step})
220 0 0 if @_ != 2
223 0 0 unless $attr_value
225 0 0 if ref $attr_value eq 'Treex::PML::List'
232 0 0 if @_ != 3
235 0 0 if (ref $attr_value eq 'ARRAY') { }
251 0 1158 if @_ != 1
258 0 1170 if @_ != 1
261 394 776 if ($self->is_root) { }
268 0 1170 unless $zone
275 0 26 if ($self->is_root)
283 9 17 if (@children)
285 0 0 if ($arg_ref and $arg_ref->{'children'})
288 0 9 if ($what_to_do =~ /^rehang/)
293 0 9 if ($what_to_do =~ /warn$/)
301 69 0 if (defined $node->id)
328 2 22 unless $refs and $refs->{$type}
329 0 22 if (defined $lang and defined $sel)
331 0 0 if ($sel eq '') { }
348 0 6 if ($type eq 'alignment') { }
352 0 0 if ($links)
358 0 6 unless defined $attr
360 5 1 if ($attr eq $id or scalar @{$attr;} <= 1) { }
372 0 262 if @_ != 1
374 261 1 unless ($self->type)
376 0 261 unless ($type)
387 0 0 if @_ != 1
393 0 19 if @_ != 1
395 19 0 if (ref($self) =~ /Node::(\w)$/) { }
404 0 7 if @_ != 1
410 0 0 if @_ != 1
427 75 108 if (scalar @_ == 1 and ref $_[0] eq 'HASH') { }
0 108 elsif (@_ % 2) { }
443 61 54 if ($attr =~ m[/] or $attr eq 'mlayer_pos' or $attr eq '#name')
467 0 183 if ($LOG_NEW)
478 0 1008 if @_ != 1
481 0 1008 unless defined $bundle
486 0 1144 if @_ != 1
492 0 1533 if @_ != 1
498 0 0 if @_ != 1
504 0 547 if @_ != 1
523 0 189 unless defined $parent
524 0 189 if ($self == $parent or $CHECK_FOR_CYCLES and $parent->is_descendant_of($self))
534 103 86 if (@fschildren) { }
556 0 132 if $arg_ref->{'ordered'} || &any(sub {
563 0 0 if $arg_ref->{'preceding_only'} and $arg_ref->{'following_only'}
565 0 0 if $arg_ref->{'first_only'} and $arg_ref->{'last_only'}
575 0 132 if defined $unknown
595 92 40 if ($arg_ref->{'add_self'})
600 52 28 if ($arg_ref->{'ordered'} || &any(sub {
608 0 132 if ($arg_ref->{'preceding_only'}) { }
0 132 elsif ($arg_ref->{'following_only'}) { }
616 0 132 if $arg_ref->{'first_only'}
617 0 132 if $arg_ref->{'last_only'}
629 171 1 unless $arg_ref
641 0 178 if ($arg_ref and $arg_ref->{'except'}) { }
643 0 0 if $self == $except_node
651 72 106 unless $arg_ref
662 4 12 unless $parent
664 12 0 unless $arg_ref
680 4 208 if $parent == $another_node
695 0 12 if @_ != 1
711 0 0 if @_ != 1
731 0 0 if (exists $wild->{'misc'} and defined $wild->{'misc'})
744 0 0 if (scalar @misc > 0) { }
760 0 0 if (defined $attr and defined $value)
766 0 0 if ($misc[$i] =~ /^(.+?)=(.+)$/ and $1 eq $attr)
768 0 0 if ($found) { }
779 0 0 unless ($found)
798 0 183 if @_ != 1
809 183 0 if ($self->get_root->id =~ /(.+)root/) { }
819 183 0 unless $doc->id_is_indexed($new_id)
837 0 0 if not defined $list or ref $list ne 'Treex::PML::List'
840 0 0 if (ref $attr_value eq 'ARRAY') { }
859 0 0 if (ref $attr_names[-1]) { }
863 0 0 defined $self->get_attr($_) ? :
887 0 372 if $links_rf
891 863 5 unless my $val = $self->get_attr($ref_attr)
892 3 2 if (not ref $val) { }
913 173 125 if ($pml_following) { }
918 40 85 ref $self eq 'Treex::Core::Bundle' ? :
921 410 0 ref $_ ne 'Treex::PML::Struct' ? :
926 40 85 if (ref $self eq 'Treex::Core::Bundle') { }
933 85 358 if ($all_trees[$index] eq $my_root)
964 0 3 if (not $AUTOLOAD =~ /DESTROY$/)