Formatter/FormatBase/Double.pm

filter: Statementstmt 81.8% 27 / 33 Branchbran 50.0% 10 / 20 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 67.5% 50 / 74 CC 13 SCAR 19.7
CC
13
Cov
66%
__ANON__
11.3
__ANON__
11.3
enc_wrap
2.4
CRAP 7.2
« Formatter/Format/DMS.pm ↑ Summary Formatter.pm »
1 package Geo::Formatter::FormatBase::Double;
2  
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 ▶use version; our $VERSION = qv('0.0.1');
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use base qw(Geo::Formatter::FormatBase);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 ▶sub enc_wrap {
Subroutine enc_wrap: called CC=2 SCAR=8.9
Pod documented
11 12 my $pkg = shift;
12  
13 13 ▶ return $pkg->can("encode") ? sub {
Subroutine __ANON__: called CC=6 SCAR=24.3
14 13 ▶ if (@_ < 2) {
Branch: 3 branches
BranchTrueFalseTotal
if (@_ < 2) { } 0 13 13
elsif (@_ > 3) { } 0 13 13
elsif (@_ == 3 and ref $_[2] ne 'HASH') { } 0 13 13
15 0 croak "Latitude and Longitude are neccesary";
16 } elsif (@_ > 3) {
17 0 croak "Too many arguments";
18 ▶ } elsif (@_ == 3 && ref($_[2]) ne "HASH") {
Condition33%1/3
@_ == 3 and ref $_[2] ne "HASH"
!ll&&!rl&&r
0130
MC/DC0%0/2
@_ == 3 and ref $_[2] ne "HASH"
@_ == 3 ref $_[2] ne "HASH"
Truth table33%1/3
A and B
A= @_ == 3B= ref $_[2] ne "HASH"
ABresult
0X0
100
111
19 0 croak "Option value must be hash reference";
20 }
21  
22 13 my @ret = $pkg->encode(@_);
23  
24 13 ▶ wantarray ? @ret : \@ret;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 13 0 13
25 12 ▶ } : undef;
Branch: 1 branch
BranchTrueFalseTotal
$pkg->can('encode') ? : 12 0 12
26 }
27  
28 12 ▶sub dec_wrap {
Subroutine dec_wrap: called CC=2 SCAR=8.9
Pod documented
29 12 my $pkg = shift;
30  
31 14 ▶ return $pkg->can("decode") ? sub {
Subroutine __ANON__: called CC=6 SCAR=24.3
32 14 ▶ if (@_ < 2) {
Branch: 3 branches
BranchTrueFalseTotal
if (@_ < 2) { } 0 14 14
elsif (@_ > 3) { } 0 14 14
elsif (@_ == 3 and ref $_[2] ne 'HASH') { } 0 14 14
33 0 croak "Latitude and Longitude are neccesary";
34 } elsif (@_ > 3) {
35 0 croak "Too many arguments";
36 ▶ } elsif (@_ == 3 && ref($_[2]) ne "HASH") {
Condition33%1/3
@_ == 3 and ref $_[2] ne "HASH"
!ll&&!rl&&r
0140
MC/DC0%0/2
@_ == 3 and ref $_[2] ne "HASH"
@_ == 3 ref $_[2] ne "HASH"
Truth table33%1/3
A and B
A= @_ == 3B= ref $_[2] ne "HASH"
ABresult
0X0
100
111
37 0 croak "Option value must be hash reference";
38 }
39  
40 14 my @ret = $pkg->decode(@_);
41  
42 14 ▶ wantarray ? @ret : \@ret;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 14 0 14
43 12 ▶ } : undef;
Branch: 1 branch
BranchTrueFalseTotal
$pkg->can('decode') ? : 12 0 12
44 }
45  
46 6 1;
47  
48 __END__
« Formatter/Format/DMS.pm ↑ Summary Formatter.pm »