PICA/Parser/Patch.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 80.0% 24 / 30 CC 3 SCAR 6.9
CC
3
Cov
83%
parse_field
3.0
_new
2.0
BEGIN
1.0
CRAP 2.0
« PICA/Writer/JSON.pm ↑ Summary PICA/Parser/JSON.pm »
1 package PICA::Parser::Patch;
2 16 ▶use v5.14.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 16 our $VERSION = '2.12';
5  
6 16 ▶use parent 'PICA::Parser::Plain';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub _new {
Subroutine _new: not called CC=1 SCAR=6.9
11 0 my $self = PICA::Parser::Base::_new(@_);
12 0 $self->annotated = undef;
13 0 $self->strict = 1;
14 0 $self;
15 }
16  
17 3 ▶sub parse_field {
Subroutine parse_field: called CC=3 SCAR=11.0
Pod undocumented
18 3 my ($self, $field) = @_;
19 3 $field = $self->SUPER::parse_field($field);
20  
21 3 ▶ return [@$field, " "] unless @$field % 2;
Branch: 1 branch
BranchTrueFalseTotal
unless @$field % 2 1 2 3
22  
23 2 my $char = $field->[$#$field];
24 2 ▶ croak "Invalid annotation: '$char'" if $char !~ /^[ +-]$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $char =~ /^[ +-]$/u 1 1 2
25  
26 1 return $field;
27 }
28  
29 16 1;
30 __END__
« PICA/Writer/JSON.pm ↑ Summary PICA/Parser/JSON.pm »