Model/Types.pm

filter: Statementstmt 71.4% 10 / 14 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 33.3% 2 / 6 Podpod n/a totaltotal 40.0% 12 / 30 SCAR 14.2
CC
3
Cov
50%
__ANON__
9.0
__ANON__
2.0
__ANON__
1.1
CRAP 4.1
« Model/Role.pm ↑ Summary Model.pm »
1 package Elasticsearch::Model::Types;
2  
3 1 use MooseX::Types -declare => [
4 qw(
5 Location
6 )
7 1 ▶];
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use MooseX::Types::Moose qw/Int Str ArrayRef HashRef Object/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 subtype Location,
12 as ArrayRef,
13 0 ▶ where { @$_ == 2 },
Subroutine __ANON__: not called CC=1 SCAR=6.9
14 0 ▶ message { "Location is an arrayref of longitude and latitude" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
15  
16 coerce Location, from HashRef,
17 0 ▶ via { [$_->{lon} || $_->{longitude}, $_->{lat} || $_->{latitude}] };
Subroutine __ANON__: not called CC=3 SCAR=22.0
Condition0%0/6
$_->{'lon'} || $_->{'longitude'}
l!l&&r!l&&!r
000
$_->{'lat'} || $_->{'latitude'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$_->{'lon'} || $_->{'longitude'}
$_->{'lon'} $_->{'longitude'}
MC/DC0%0/2
$_->{'lat'} || $_->{'latitude'}
$_->{'lat'} $_->{'latitude'}
Truth table0%0/3
A || B
A= $_->{'lon'}B= $_->{'longitude'}
ABresult
1X1
011
000
Truth table0%0/3
A || B
A= $_->{'lat'}B= $_->{'latitude'}
ABresult
1X1
011
000
18 0 ▶coerce Location, from Str, via { [reverse split(/,/)] };
Subroutine __ANON__: not called CC=1 SCAR=1.2
19  
20 1 1;
« Model/Role.pm ↑ Summary Model.pm »