PICA/Parser/JSON.pm

filter: Statementstmt 100% 16 / 16 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 24 / 24 CC 3 SCAR 6.9
CC
3
Cov
100%
_next_record
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« PICA/Parser/Patch.pm ↑ Summary PICA/Writer/Plus.pm »
1 package PICA::Parser::JSON;
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 JSON::PP;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 16 our $JSON = JSON::PP->new;
8  
9 16 ▶use parent 'PICA::Parser::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 9 ▶sub _next_record {
Subroutine _next_record: called CC=3 SCAR=11.0
12 9 my ($self) = @_;
13  
14 9 ▶ if (my $line = $self->{reader}->getline) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $line = $self->{"reader"}->getline) 8 1 9
15 8 my $record = $JSON->decode($line);
16 8 ▶ $record = $record->{record} if ref $record eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if ref $record eq "HASH" 1 7 8
17  
18 8 return $record;
19  
20 # TODO: cleanup occurrence and annotation
21 }
22 }
23  
24 16 1;
25 __END__
« PICA/Parser/Patch.pm ↑ Summary PICA/Writer/Plus.pm »