Validator/Utils.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 90.3% 28 / 31 CC 2 SCAR 2.8
CC
2
Cov
92%
check_260c_year
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Validator/Abstract.pm ↑ Summary Validator.pm »
1 package MARC::Validator::Utils;
2  
3 12 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 ▶use Data::MARC::Validator::Report::Error 0.02;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 Readonly::Array our @EXPORT_OK => qw(check_260c_year);
11  
12 12 our $VERSION = 0.25;
13  
14 2 ▶sub check_260c_year {
Subroutine check_260c_year: called CC=2 SCAR=7.6
Pod undocumented
15 2 my ($self, $value, $field) = @_;
16  
17 2 ▶ if ($value =~ m/^\(\d+\)$/ms) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value =~ /^\(\d+\)$/ms) 2 0 2
18 2 return Data::MARC::Validator::Report::Error->new(
19 'error' => 'Bad year in parenthesis in MARC field '.$field.' $c.',
20 'params' => {
21 'Value' => $value,
22 },
23 );
24 }
25  
26 0 return ();
27 }
28  
29 12 1;
30  
31 __END__
« Validator/Abstract.pm ↑ Summary Validator.pm »