Validator/Plugin/Field264.pm

filter: Statementstmt 52.6% 20 / 38 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 6 / 10 Podpod 100% 4 / 4 totaltotal 55.5% 30 / 54 CC 4 SCAR 19.6
CC
4
Cov
50%
process
20.0
module_name
2.0
name
2.0
CRAP 7.1
« Validator/Plugin/Field300.pm ↑ Summary Validator/Plugin/Field020.pm »
1 package MARC::Validator::Plugin::Field264;
2  
3 4 ▶use base qw(MARC::Validator::Abstract);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use Data::MARC::Validator::Report::Error 0.02;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Data::MARC::Validator::Report::Plugin::Errors 0.02;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use MARC::Validator::Utils qw(check_260c_year);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 our $VERSION = 0.25;
12  
13 0 ▶sub module_name {
Subroutine module_name: not called CC=1 SCAR=6.9
Pod documented
14 0 my $self = shift;
15  
16 0 return __PACKAGE__;
17 }
18  
19 0 ▶sub name {
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
20 0 my $self = shift;
21  
22 0 return 'field_264';
23 }
24  
25 0 ▶sub process {
Subroutine process: not called CC=4 SCAR=30.0
Pod documented
26 0 my ($self, $marc_record) = @_;
27  
28 0 my $record_id = $self->{'cb_record_id'}->($marc_record);
29 0 my @record_errors;
30  
31 0 my @field_264 = $marc_record->field('264');
32 0 foreach my $field_264 (@field_264) {
33 0 my @field_264_c = $field_264->subfield('c');
34 0 foreach my $field_264_c (@field_264_c) {
35 0 push @record_errors, check_260c_year($self, $field_264_c, '264');
36 }
37 }
38  
39 0 ▶ if (@record_errors) {
Branch: 1 branch
BranchTrueFalseTotal
if (@record_errors) 0 0 0
40 0 push @{$self->{'errors'}}, Data::MARC::Validator::Report::Plugin::Errors->new(
41 'errors' => \@record_errors,
42 0 'filters' => $self->{'filters'},
43 'record_id' => $record_id,
44 );
45 }
46  
47 0 return;
48 }
49  
50 0 ▶sub version {
Subroutine version: not called CC=1 SCAR=6.9
Pod documented
51 0 my $self = shift;
52  
53 0 return $VERSION;
54 }
55  
56 4 1;
57  
58 __END__
« Validator/Plugin/Field300.pm ↑ Summary Validator/Plugin/Field020.pm »