Branch Coverage

blib/lib/Gedcom/Record.pm
Criterion Covered Total %
branch 129 182 70.8


line true false branch
41 0 26 unless $Gedcom::Funcs{lc $func}
48 3106 7 if (wantarray) { }
51 3013 78 defined $v && length $v ? :
3091 0 if ($_)
65 3114 200 ref $_ ? :
67 3114 208 if ref $func eq 'ARRAY'
68 0 3322 if (ref $func)
73 0 3322 unless ($record)
74 0 0 $func ? :
0 0 unless $func =~ /^_/
84 0 3322 if $record eq 'FAMS' or $record eq 'FAMC'
87 3202 17 wantarray ? :
92 96 7 if (wantarray) { }
93 82 0 length $v ? :
82 0 if defined $v
103 52042 10069 if (wantarray) { }
104 52995 0 length $v ? :
52995 0 if defined $v
116 0 80 unless defined $args{'tag'}
124 0 80 if (not defined $self->{'grammar'}) { }
80 0 elsif (my(@g) = $self->{'grammar'}->item($args{'tag'})) { }
132 6 76 if ($args{'tag'} eq 'NOTE') { }
133 5 1 if (defined $args{'xref'} and $g->{'value'} =~ /xref/i or not defined $args{'xref'} || $g->{'value'} =~ /xref/i)
140 67 9 if (defined $args{'val'} and $g->{'value'} or not defined $args{'val'} || $g->{'value'})
161 59 3 if (@_ > 1 and ref $_[-1] ne 'ARRAY')
163 6 53 if (UNIVERSAL::isa($val, 'Gedcom::Record'))
169 2 62 ref $_ ? :
170 61 1 unless ref $funcs[-1]
174 6 56 if (defined $xref)
179 53 9 if (defined $val)
190 0 1 ref $_ ? :
193 0 1 if (UNIVERSAL::isa($val, 'Gedcom::Record')) { }
211 72 0 unless defined $args
212 63 9 if ref $func eq 'ARRAY'
215 0 72 if (ref $func)
221 0 72 unless ($record)
222 0 0 $func ? :
0 0 unless $func =~ /^_/
233 61 11 if ($count < 0) { }
7 4 elsif ($#records < $count) { }
260 0 6531 if $t and $t ne $g
264 1718 4813 if $class
278 0 5590 unless $i->level =~ /^[+0]/ or $i->level == $r->level
282 15 5575 if $i->value and $i->value =~ /^pointer || 0)
291 5 5575 unless (@i)
295 0 5 unless (substr($tag, 0, 1) eq '_')
298 0 0 unless $test
309 5575 0 if $m = $self->parse($r, $i, @i > 1)
312 0 5580 if (@i > 1 and not $m)
331 2745 19116 if defined $self->{'xref'}
345 1195 16 defined $x ? :
12608 1211 ref $_ ? :
347 15252 8 wantarray ? :
353 2572 20231 if (my $xref = $self->{'gedcom'}->resolve_xref($self->{'value'}))
366 2056 0 if defined $self->{'value'} and UNIVERSAL::isa($self->{'value'}, 'Gedcom::Record') and exists $self->{'value'}{'xref'}
376 16500 53489 unless exists $self->{'grammar'}
379 0 53489 if defined $self->{'gedcom'}{'validate_callback'}
383 0 0 defined $grammar->{'tag'} ? :
0 53489 if $D
386 8648 44841 defined $self->{'xref'} ? :
390 680 51292 if defined $self->{'value'} and length $self->{'value'} and not defined $grammar->{'value'}
393 0 69928 if $D
396 0 69928 if $record->{'level'} > $self->{'level'} + 1
398 1364 68564 unless $record->validate_syntax
406 55339 581669 $matches == 1 ? :
407 0 637008 if $D
408 0 637008 if $matches < $min
409 2 637006 if $matches > $max and $max
414 0 60 unless substr($tag, 0, 1) eq '_'
439 365 8405 unless $self->{'tag'} eq 'INDI' or $self->{'tag'} eq 'FAM'
449 8640 6604 unless ref $record
450 15240 4 if ($record)
455 11560 8840 unless ref $i
456 15240 5160 if ($i and $i->{'xref'} eq $self->{'xref'})
463 0 0 unless ($found)
481 0 7578 unless ($INC{'Date/Manip.pm'})
485 0 7578 if (eval { do { 'Date::Manip'->VERSION(6) } } and not eval { do { 'Date::Manip'->VERSION(6.13) } })
492 906 6672 if (defined $self->{'tag'} and $self->{'tag'} =~ /^date$/i)
493 906 0 if (defined $self->{'value'} and $self->{'value'})
503 6 900 if $dt =~ /^AFT/
506 642 258 if (not $dt =~ /^\s*(\d+)\s*$/ or length $1 > 6)
509 630 12 if $d
517 1758 5820 if $self->level > 1
524 9104 4496 if exists $self->{'recursed'} or not defined $self->{'xref'}
526 13 4483 $self->{'tag'} eq 'SUBM' ? :
528 1736 2760 unless exists $self->{'new_xref'}
529 2760 1736 unless $recurse and not exists $self->{'recursed'}
531 1121 615 if ($self->{'tag'} eq 'INDI')
562 0 0 $r ? :
564 0 0 $r ? :
566 0 0 if ($r = $self->tag_record('BIRT') and my $date = $r->tag_record('DATE'))