| 1 | 3 | ▶ | use 5.008008; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package portable::loader::JSON; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 3 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||
| 8 | 3 | our $VERSION = '0.003'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 3 | ▶ | use portable::lib; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 3 | ▶ | use portable::loader; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 3 | ▶ | sub init { | ||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 14 | 3 | my $me = shift; | |||||||||||||||||||
| 15 | 3 | my ($loader) = @_; | |||||||||||||||||||
| 16 | 3 | $loader->register_extension('portable.json'); | |||||||||||||||||||
| 17 | 3 | return; | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 3 | our $decoder; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | ▶ | sub parse { | ||||||||||||||||||
|
Subroutine
parse: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 23 | 0 | my $me = shift; | |||||||||||||||||||
| 24 | 0 | my ($filename) = @_; | |||||||||||||||||||
| 25 | 0 | require JSON::Eval; | |||||||||||||||||||
| 26 | 0 | ▶ | $decoder ||= JSON::Eval->new; | ||||||||||||||||||
|
Condition0%0/3
$portable::loader::JSON::decoder ||= "JSON::Eval"->new
MC/DC0%0/2
$portable::loader::JSON::decoder ||= "JSON::Eval"->new
$portable::loader::JSON::decoder
"JSON::Eval"->new
Truth table0%0/3
A ||= B
A= $portable::loader::JSON::decoderB= "JSON::Eval"->new
| |||||||||||||||||||||
| 27 | 0 | my $jsontext = do { | |||||||||||||||||||
| 28 | 0 | ▶ | open my $fh, '<', $filename | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | or die "Could not open $filename: $!"; | ||||||||||||||||||||
| 30 | 0 | local $/; | |||||||||||||||||||
| 31 | 0 | <$fh>; | |||||||||||||||||||
| 32 | }; | ||||||||||||||||||||
| 33 | 0 | return ($filename => $decoder->decode($jsontext)); | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 3 | 1; | |||||||||||||||||||
| 37 | |||||||||||||||||||||