Branch Coverage

blib/lib/MARC/Lint.pm
Criterion Covered Total %
branch 150 188 79.7


line true false branch
112 64 0 wantarray ? :
160 0 13 unless ref $marc and $marc->isa('MARC::Record')
165 1 12 if ($n1xx > 1)
169 0 13 unless ($marc->field(245))
182 3 205 if ($tagno eq '880') { }
184 2 1 if ($field->subfield('6')) { }
188 0 2 unless $tagrules = $rules->{$tagno}
190 0 2 if ($tagrules->{'repeatable'} and $tagrules->{'repeatable'} eq 'NR' and $field_seen{'880.' . $tagno})
200 1 204 unless $tagrules = $rules->{$tagno}
202 0 110 if ($tagrules->{'repeatable'} and $tagrules->{'repeatable'} eq 'NR' and $field_seen{$tagno})
207 159 47 if ($tagno >= 10) { }
47 0 elsif ($tagno < 10) { }
210 5 313 unless ($indvalue =~ /$$tagrules{"ind$ind" . '_regex'}/)
224 3 261 if (not defined $rule) { }
1 260 elsif ($rule eq 'NR' and $sub_seen{$code}) { }
230 0 264 if ($data =~ /[\t\r\n]/)
240 1 46 if ($field->data =~ /\x1F/)
247 25 181 if ($self->can($checker))
251 2 204 if ($is_880) { }
305 21 1 if ($code eq 'a') { }
1 0 elsif ($code eq 'z') { }
306 2 19 if (substr($data, 0, length $isbnno) ne $isbnno)
311 8 13 if ($data =~ /\(/)
312 2 6 unless $data =~ /[X0-9] \(/
316 3 18 if (not $isbnno =~ /(?:^\d{10}$)|(?:^\d{13}$)|(?:^\d{9}X$)/) { }
321 16 2 if (length $isbnno == 10) { }
2 0 elsif (length $isbnno == 13) { }
323 16 0 if ($Business::ISBN::VERSION gt '2.02_01' or $Business::ISBN::VERSION gt '2.009') { }
0 0 elsif ($Business::ISBN::VERSION lt '2') { }
324 4 12 if Business::ISBN::valid_isbn_checksum($isbnno) != 1
327 0 0 if Business::ISBN::is_valid_checksum($isbnno) != 1
340 1 1 unless $is_valid_13 == 1
347 0 1 if ($data =~ /^ISBN/ or $data =~ /^\d*\-\d+/)
351 0 0 if length $isbnno == 10 and Business::ISBN::is_valid_checksum($isbnno) == 1
386 1 1 $check_digit == $valid_check_digit ? :
421 3 0 unless ($field->indicator(2) eq '7')
423 3 4 if (length($newsubfields[$index + 1]) % 3 != 0) { }
446 0 6 $MARC::Lint::LanguageCodes{$code041} ? :
448 1 5 $MARC::Lint::ObsoleteLanguageCodes{$code041} ? :
451 6 0 unless ($validlang)
453 1 5 if ($obsoletelang) { }
493 2 3 if ($newsubfields[$index] eq 'a' and length $newsubfields[$index + 1] != 7) { }
3 0 elsif ($newsubfields[$index] eq 'a') { }
500 0 3 $MARC::Lint::GeogAreaCodes{$newsubfields[$index + 1]} ? :
502 1 2 $MARC::Lint::ObsoleteGeogAreaCodes{$newsubfields[$index + 1]} ? :
505 3 0 unless ($validgac)
507 1 2 if ($obsoletegac) { }
546 1 48 unless ($field->subfield('a'))
559 2 88 if $code eq '6'
565 1 48 if (not $newsubfields[$#newsubfields] =~ /[.?!]$/) { }
2 46 elsif ($newsubfields[$#newsubfields] =~ /[?!]$/) { }
574 2 47 if ($has_sub_6) { }
576 0 2 if ($#newsubfields < 3) { }
580 0 2 if ($newsubfields[0] ne '6')
583 0 2 if ($newsubfields[2] ne 'a')
590 1 46 if ($newsubfields[0] ne 'a')
598 14 35 if ($field->subfield('c'))
602 14 3 if ($newsubfields[$index] eq 'c')
603 2 12 unless $newsubfields[$index - 1] =~ m[\s/$]
605 1 13 if $newsubfields[$index + 1] =~ /\b\w\. \b\w\./ and not $newsubfields[$index + 1] =~ /\[\bi\.e\. \b\w\..*\]/
613 13 36 if ($field->subfield('b'))
618 4 12 if ($newsubfields[$index] eq 'b' and not $newsubfields[$index - 1] =~ / [:;=]$/)
626 4 45 if ($field->subfield('h'))
631 1 5 if ($newsubfields[$index] eq 'h' and not $newsubfields[$index - 1] =~ /(\S$)|(\-\- $)/)
636 1 5 if ($newsubfields[$index] eq 'h' and not $newsubfields[$index + 1] =~ /^\[\w*\s*\w*\]/)
643 4 45 if ($field->subfield('n'))
648 1 5 if ($newsubfields[$index] eq 'n' and not $newsubfields[$index - 1] =~ /(\S\.$)|(\-\- \.$)/)
655 4 45 if ($field->subfield('p'))
660 4 2 if ($newsubfields[$index] eq 'p')
662 1 3 if ($newsubfields[$index - 2] eq 'n' and not $newsubfields[$index - 1] =~ /(\S,$)|(\-\- ,$)/) { }
1 3 elsif ($newsubfields[$index - 2] ne 'n' and not $newsubfields[$index - 1] =~ /(\S\.$)|(\-\- \.$)/) { }
772 1 48 if ($tagno eq '880')
773 1 0 if ($field->subfield('6'))
783 0 49 if (not $tagno =~ /^(?:130|240|245|440|630|730|830)$/) { }
0 49 elsif ($tagno =~ /^(?:130|630|730)$/) { }
49 0 elsif ($tagno =~ /^(?:240|245|440|830)$/) { }
800 0 49 unless $ind =~ /^[0-9]$/
814 1 48 unless defined $firstword
815 1 48 unless defined $separator
816 1 48 unless defined $etc
831 9 40 if $article{$firstword} and not $isan_exception
834 9 40 if ($isan_article) { }
837 4 5 if ($separator and $etc =~ /^[ \(\)\[\]'"\-]+/)
844 0 9 if ($firstword eq 'en') { }
3 6 elsif ($nonfilingchars ne $ind) { }
845 0 0 unless $ind eq '3' or $ind eq '0'
853 1 39 unless ($ind eq '0')
930 102 1362 unless @lines >= 4
959 2724 14466 if ($key =~ /^ind/) { }
965 1674 1050 if ($val eq 'blank') { }
978 0 14466 if ($key =~ /(.)-(.)/) { }
992 60 990 if ($str =~ s/(\d)-(\d)/$1 thru $2/)
997 516 474 if $digits[0] eq 'b'
1005 0 0 if $str eq 'blank'