blib/lib/JSON/Types.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 32 / 32 CC 4 SCAR 5.1
CC
4
Cov
100%
number
2.0
string
2.0
bool
2.0
CRAP 1.7
↑ Summary
1 package JSON::Types;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.05';
7 2 our @EXPORT = qw/number string bool/;
8  
9 4 ▶sub number($) {
Subroutine number: called CC=2 SCAR=6.9
Pod documented
10 4 ▶ return undef unless defined $_[0];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_[0] 2 2 4
11 2 $_[0] + 0;
12 }
13  
14 3 ▶sub string($) {
Subroutine string: called CC=2 SCAR=6.9
Pod documented
15 3 ▶ return undef unless defined $_[0];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_[0] 2 1 3
16 1 $_[0] . '';
17 }
18  
19 3 ▶sub bool($) {
Subroutine bool: called CC=2 SCAR=6.9
Pod documented
20 3 ▶ $_[0] ? \1 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 1 2 3
21 }
22  
23 2 1;
24  
25 __END__
↑ Summary