JSON/PP58.pm

filter: Statementstmt 51.8% 14 / 27 Branchbran 33.3% 2 / 6 Conditioncond 6.6% 1 / 15 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 42.8% 3 / 7 Podpod 100% 4 / 4 totaltotal 34.7% 24 / 69 CC 9 SCAR 18.8
CC
9
Cov
35%
incr_text
12.0
BEGIN
6.0
incr_parse
6.0
CRAP 6.5
« JSON/PP5005.pm ↑ Summary JSON/PP/Boolean.pm »
1 package JSON::PP58;
2  
3 3 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 my @properties;
7  
8 3 $JSON::PP58::VERSION = '1.03';
9  
10  
11 BEGIN {
12  
13 3 ▶ unless ( defined &utf8::is_utf8 ) {
Subroutine BEGIN: called CC=4 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
unless (defined &utf8::is_utf8) 0 3 3
14 0 require Encode;
15 0 *utf8::is_utf8 = *Encode::is_utf8;
16 }
17  
18 3 *JSON::PP::JSON_PP_encode_ascii = \&JSON::PP::_encode_ascii;
19 3 *JSON::PP::JSON_PP_encode_latin1 = \&JSON::PP::_encode_latin1;
20 3 *JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates;
21 3 *JSON::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode;
22  
23 3 ▶ if ($] >= 5.008 and $] < 5.008003) { # join() in 5.8.0 - 5.8.2 is broken.
Branch: 1 branch
BranchTrueFalseTotal
if ($] >= "5.008" and $] < "5.008003") 0 3 3
Condition33%1/3
$] >= "5.008" and $] < "5.008003"
!ll&&!rl&&r
030
MC/DC0%0/2
$] >= "5.008" and $] < "5.008003"
$] >= "5.008" $] < "5.008003"
Truth table33%1/3
A and B
A= $] >= "5.008"B= $] < "5.008003"
ABresult
0X0
100
111
24 package JSON::PP;
25 0 require subs;
26 0 subs->import('join');
27 0 eval q|
28 sub join {
29 return '' if (@_ < 2);
30 my $j = shift;
31 my $str = shift;
32 for (@_) { $str .= $j . $_; }
33 return $str;
34 }
35 |;
36 }
37  
38 }
39  
40  
41 sub JSON::PP::incr_parse {
42 0 ▶ local $Carp::CarpLevel = 1;
Subroutine incr_parse: not called CC=2 SCAR=17.9
Pod documented
43 0 ▶ ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_parse( @_ );
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
44 }
45  
46  
47 sub JSON::PP::incr_text : lvalue {
48 0 ▶ $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new;
Subroutine incr_text: not called CC=3 SCAR=24.8
Pod documented
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
49  
50 0 ▶ if ( $_[0]->{_incr_parser}->{incr_parsing} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_[0]{"_incr_parser"}{"incr_parsing"}) 0 0 0
51 0 Carp::croak("incr_text can not be called when the incremental parser already started parsing");
52 }
53 0 $_[0]->{_incr_parser}->{incr_text};
54 }
55  
56  
57 sub JSON::PP::incr_skip {
58 0 ▶ ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_skip;
Subroutine incr_skip: not called CC=2 SCAR=17.9
Pod documented
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
59 }
60  
61  
62 sub JSON::PP::incr_reset {
63 0 ▶ ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_reset;
Subroutine incr_reset: not called CC=2 SCAR=17.9
Pod documented
Condition0%0/3
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
64 }
65  
66  
67 3 1;
68 __END__
« JSON/PP5005.pm ↑ Summary JSON/PP/Boolean.pm »